XLIFF SyncA VSCode extension to keep XLIFF translation files in sync with a specified, automatically generated base-XLIFF file. Update: There is now also an "XLIFF Sync" PowerShell module! This project originated from the need for a tool to automatically merge/synchronize XLIFF translation files that are in the OASIS specification.
This extension is based on the Angular Localization Helper developed by manux54, which has been extended so that it can also be used to synchronize files from other XLIFF generators.
It is specifically targeted at synchronizing trans-units from an Features
ContributionsCommands
Settings
UsageThe extension will try to find corresponding trans-units and translations within an existing file as follows:
If no trans-unit or translation is found, the unit is added and its target node is tagged with Create New Target File(s)Using the Command Palette
This command will let you create one or more new target files, letting you choose from a set of RFC 4646 or RFC 5646 language tags depending on the XLIFF file type (i.e., Synchronize to Single FileUsing the Command Palette
Using keyboard shortcut
By default, the extension expects the base-XLIFF file to be named You can also use this command to create a new XLIFF file for a language. For this, choose the "New File..." option and choose the language tag for the new target language. Synchronize Translation UnitsUsing the Command Palette
NOTE: This command will merge new translations into all XLIFF files in your workspace folder (with, obviously, excluding the base-XLIFF file itself). Using keyboard shortcut
From the Explorer
If you select the base-XLIFF file, then translation units will be synced to all other XLIFF files in the workspace. If you select any other XLIFF file, then translation units will be synced from the base-XLIFF file to the selected file. Here's a small demo: Check for Missing TranslationsUsing the Command Palette
This will check all XLIFF files in the workspace and notify about any missing translations in the files. You also have the option to open files with missing translations with your default XLIFF editor using the Open Externally button from the informational message. Check for Need Work TranslationsUsing the Command Palette
This will run technical validation/checks for all XLIFF files in the workspace and notify about any translations that need work in the files. You also have the option to open files containing problems with your default XLIFF editor using the Open Externally button from the informational message. The target node of the trans-units containing problems will be tagged with You can configure the checks that need to be run with the
Note: You may want to use rule Find Next Missing Translation in XLIFF FileUsing the Command Palette
Using keyboard shortcut
Missing translations are tagged and highlighted. You can use the extension to navigate between missing translations. On a Macbook Pro, this command appears on the touchbar within XLIFF files. Find Next Needs Work Translation in XLIFF FileUsing the Command Palette
Using keyboard shortcut
Translations that need work are tagged and highlighted. You can use this command to navigate between translations that need work. On a Macbook Pro, this command appears on the touchbar within XLIFF files. Import Translations from File(s)Using the Command Palette
This will open a file dialog in which you can select one or more XLIFF files (.xlf or .xlf2). The command will copy translations from the selected files to trans-units in the XLIFF files in your project folder with the same target-language for matching sources. It will try first to merge translations for trans-units with a matching combination of source-text and Developer note, and only after that try to merge translations to trans-units with matching source-text. That way you could utilize the Developer note to have the import perform a more precise merge of the translations (e.g., based on tags in the Developer notes). Known Issues
|