This extension provides an editor for Angular generated xliff file. If you're struggling handle the xliff files that generated by AngularCLI, this extension might be helpful for you.
This extension provides a friendly to use editor for users to translate their apps.
After you translated one trans unit, you can click ctrl
+ enter
to save and lock (signed-off
) your translation.
Translations that mark as signed-off
could not be edit in the editor, unless you unlock them.
The code context shows the location where the translation will be apply to.
This will help you write better translations.
Translation memory is to store your tranlation history and will give you suggestion for your transunits.
This feature is on the roadmap but not yet started.
This extension will only be activated when the extension setting file is under your workspace root directory. Make sure you place the .ngI18nconfig
file correctly.
Extension setting is a json file that placed in the root directory of the workspace, using the name .ngI18nconfig
(case sensitive). The following is the configuration options:
Path | Object Type | Description |
---|---|---|
locales |
string[] |
The locales setting accepts one ore more target locales that your application is going to be translated into. See: Locale Setting. |
editor |
object |
The editor setting is to control the behavior of I18n editor as well as the background task manager. See: Editor Setting |
editor.taskConfig |
object |
The editor.taskConfig is to control the background task manager, which executes the transunit saving commands. See: Task Config Setting |
The locales setting accepts one ore more target locales that your application is going to be translated into.
{
"locales": ["zh-CN", "ja-JP"]
}
The editor setting is to control the behavior of I18n editor as well as the background task manager.
Three types of trigger type that tell the editor when to save your translation. The default value is blur
.
Only support blur
by far.
The message locations is the location collection for the Angular Compiler extracted xliff files. They should
ends with .xliff
or .xlf
.
{
"editor": {
"messageLocations": ["src/locale/messages.xlf"]
}
}
The pattern to locate the target translation file. The default value is ${name}(${lang}-${region})
.
${name}
: the source xliff file name;${lang}
: the target language;${region}
: the region where the language in use.
${lang}
and ${region}
is the consist parts of LCID
Editor mode.
-
The
default
mode:Use the xliff specify in the
messageLocations
as source and auto generate the target translation xliff based on the giventranslationFileNamePattern
; -
The
target-file
mode:Edit directly on the target xliff (based on the
messageLocations
and the giventranslationFileNamePattern
)
Determine how to handle empty translation.
delete
: delete the trans unit in the target xliff when empty;keep
: keep the trans unit in the target xliff and mark asneed-translation
;fallback-to-source
: fill the translation target using the source string and mark asneed-translation
;
When editor is in default
mode, this option is set delete
as default; When editor is in target-file
mode, this option is set fallback-to-source
as default;
The editor.taskConfig
is to control the background task manager, which executes the transunit saving commands.
{
"editor": {
"taskConfig": {
"intervalSeconds": 5,
"itemEachPack": 10
}
}
}
The frequency of task checking. Default value is 5
.
The maximum command size for each task execution. Default value is 10
.
(CURRENTLY NOT AVAILABLE)
If you do like this extension, please give me feedback so I know you are using it. If you do like more features, tell me and we can start a discussion.
If you have any problems, go and fire an issue.
The current version is just build for temporary use. Please verify your translation file before building your application into the target locale.