Skip to content

Tools: Localization

David Gómez edited this page May 31, 2019 · 2 revisions

The localization tool is located here. You can build and run it to extract files for localization or verify language variations.

Extract files to localization

This tool compares two WTS folders and obtains the locatable files that have differences between the two folders with its language variants and maintaining the folder structure. Extract files executing the following command:

localization ext -o "original_WTS_project_folder" -a "actual_WTS_project_folder" -d "destination_folder"

where:

  • original_WTS_project_folder: initial version of WTS to compare. Normally we will obtain this version using the tag created the last time localization files were sent (it´s explained later).

  • actual_WTS_project_folder: current version of WTS. This version is the last commit in the dev branch.

  • destination_folder: Destination folder where we will obtain the extraction result. The following subfolders will be created:

    • original: contains the locatable files found in the "original_WTS_project_folder" folder.
    • actual: contains the locatable files found in the "actual_WTS_project_folder" folder.
    • diff: contains the files with differences between the "actual" and "original" folder, maintaining the WTS folder structure and variations of all the languages (in .resx files, contains only changed resources).

Example:

localization ext -o "C:\Users\myuser\Documents\Projects\WindowsTemplateStudio_Old" -a "C:\Users\myuser\Documents\Projects\WindowsTemplateStudio" -d "C:\Users\myusers\Desktop\localFileFolder"

Once the extractor is done we will send the contents of the "diff" folder to the translation team. We will also create a tag in the current commit of the dev branch. So we mark the last sending of localizable files and the next time we use the tool, we will use this tag to obtain "original_WTS_project_folder".

Merge translated files to WTS

When the translated files are returned and are verified, we can merge to update WTS resource files. To do we execute the following command:

Localization merge -s "translation_files_folder" -d "WTS_project_folder"

where:

  • translation_files_folder: folder that contains the translated resource files.
  • WTS_project_folder: current version of WTS.

Example:

localization merge -s "C:\Users\myusers\Desktop\translateFilesFolder" -d "C:\Users\myuser\Documents\Projects\WindowsTemplateStudio"

Once translations files are merged and verified we commit to github to update WTS.

Verify localization files

We can verify the received files are correct and not missing resx values executing the next command:

localization verify -s "WTS_project_folder"

Example:

localization verify -s "C:\Users\myuser\Documents\Projects\WindowsTemplateStudio"

Generate templates language files

When we created a template, we need to create translation files for template.json and description.md. To simplify this process, we can use LocalizationTool with the gen command:

localization gen -s "WTS_templates_folder"

where:

  • WTS_templates_folder: folder that contains source files for templates.

example:

localization gen -s "C:\Users\myuser\Documents\Projects\WindowsTemplateStudio\templates"

This command generates all missing translation files for all templates in the selected folder. For this, it will take as reference the original .json or .md file.