AL Translation Pack
This extension creates an XLF file for each language used in the Auto Translate Language
setup.
For caption\tooltip\label the translation can be inserted in english in the comments using multilanguage formatting.
For example:
Caption = 'Item No.', Comment = 'ITA="Nr. Articolo",ESP="Artículo No.",FRA="Numéro d'article"';
If the comment is not evaluated, the caption\tooltip\label is automatically translated.
The Translations are saved to the AutoTranslate.json
file when the .al file is closed.
If you want to edit the translation (automatic or from comment string
), you will need to go to the AutoTranslate.json
file and edit the translation in the specific language.
For example (in the AutoTranslate.json
file):
"Name":{"ITA":"Nome","FRA":"Prénom"}
It will be changed to:
"Name":{"ITA":"Nome","FRA":"Nom"}
The translations that will be taken to compile the .xlf file will always be those present in the AutoTranslate.json
file.
If a translation other than the one already inserted in the AutoTranslate.json
file is specified in the comments, it will not be taken into consideration for the translation.
Features
To start creating/updating the translation file you need to use the Update translations (XLF)
function.
Every time you want to update the translation files (XLF) you need to run this function.
Translation files are also automatically updated when you save an .al file.
The translation line can also be added by selecting the Add Translation
item from the menu, indicating which type of translation you want to insert (caption, tooltip or label) and then entering the string to be translated in the dialog box.
This will insert both the selected property (caption, tooltip or label) and the comment with the translation in the languages entered in the Auto Translations (XLF)
setup.
If the translation command has already been entered, you can select "Translate Line" from the drop-down menu and the extension will only create the translation in the languages entered in the Auto Translations (XLF)
setup.
In addition, the following snippets have been implemented:
- CaptionWithComment:
Caption = 'CaptionString', Comment = 'TranslationLanguage="TranslationString"';
- LabelWithComment:
LabelName: Label 'LabelString', Comment = 'TranslationLanguage="TranslationString"';
- TooltipWithComment:
Tooltip = 'TooltipString', Comment = 'TranslationLanguage="TranslationString"';
- CommentForTranslation:
, Comment = 'TranslationLanguage="TranslationString"';
To find the reference to the translation displayed, you can left-click on the caption\tooltip\label and select Find Translation Line
.
Finally, was added the function Update AutoTranslate File (JSON)
that automatically translate the AutoTranslate File.
By popular demand and for everyone's convenience
Some features have been added that are not directly related to translation but are really convenient.
- Open Related Object
By right-clicking an 'al' file (in the file list or inside the editor) and clicking on the "Open Related Object" item, the system will ask in which environment you want to open the table. Once the environment has been selected, a default browser page will open with the link to the selected Object.
Settings
This extension contributes the following variables to the settings:
Auto Translate Language
This option represents the languages that you want to be automatically translated by the Auto Translations (XLF)
feature. These can be listed separated by a comma.
For example: ITA,FRA,ESP
When the Auto Translate Language
is specified, the translations are performed in the specified languages and the Snippets are modified to replace TranslationLanguage
with the specified code.
So if the Auto Translate Language
is set to ITA the Snippets are modified as follows:
- CaptionWithComment:
Caption = 'CaptionString', Comment = 'ITA="TranslationString"';
- LabelWithComment:
LabelName: Label 'LabelString', Comment = 'ITA="TranslationString"';
- TooltipWithComment:
Tooltip = 'TooltipString', Comment = 'ITA="TranslationString"';
- CommentForTranslation:
, Comment = 'ITA="TranslationString"';
Known Issues
When in a comment
a double quote is used within the translation, it does not correctly recognize the string to be translated.
For example:
TestFieldErr: Label 'The "Item No." field must be completed.', Comment = 'ITA="Il campo "Nr. Articolo" deve essere valorizzato."';
In this case, using the string "Nr. Articolo" within the comment, this create problems in correctly finding the translation.