I think, and a lot of people too I guess, translations take a lot of work, and I strongly like to avoid do this kind of things:
Type in the target .xlf file. It´s very hard to edit the final .xlf. If you saw any .xlf file you can understand me, not the kind of things people like to do.
Translate twice. If you already translated, or NAV or txt2AL did it, “Posting Date” to “Fecha registro”, you don´t have to do it again….never.
But we have our own approach to the subject. So, for ease the translation, we see the steps below:
- Begin translation getting the original English .xlf file. From this file we can extract what to translate and remove the duplicates texts. We save in an internal object the distinct captions to translate in the app.
- The second step is using previous old .xlf translation files in your native language: the NAV standard Spanish .xlf file, the .xlf Spanish translation generated by txt2Al tool, or whatever previous .xlf files you want to use. You can process all the files you want to take advantage of all previous translations anyone has made.
- After this step above, I have a lot of translation done working almost nothing. The next thing I want to have are the remaining translations, captions that don´t have translations yet, without duplicates in an Excel file to end the work. This must be the only manual work in the process
- The final step must be building the final xlf in the target language: the file must be done merging the original file, previous translation files and our manual final translations in the Excel plain file text files with tabulations.
Start creating a new .json empty file Control + N and Control + S. Name it whatever you want, but important, the file extension must be .json, this way we have object validation. Inside the new .json file you can type the snippet “TJAMCreateTransFile” and brings you the four steps structure:
The set of each step must be filled the way is described below.
"OriginalXlfFile": [
{"SkipStep": false},
{"Path": "C:/Users/Jesus/Documents/AL/WarehouseAssistant/Translations/WarehouseAssistant.g.xlf"
This step starts with the English .xlf process. Here we must set the file generated in our first package generation with:
This steps process this .xlf and create an internal (you don´t have to see it if you don´t like) json file, with original captions without duplicates and waiting for translations in target properties. The json file is for internal use of the extension is named here for didactical purpose.
The step 2 feed the target translation from previous translation files:
"PreviousTranslationsFiles": [
{"SkipStep": false},
{"Files": [
{"Path": "C:/Users/Jesus/Documents/AL/WarehouseAssistant/Translations/WarehouseAssistant.g copy.xlf"},
{"Path": "C:/Users/Jesus/Documents/Spanish language (Spain).Source/Translations/Base Application.es-ES.xlf"}
The first file is the translations that we got after the txt2al process. The second one is the standard Spanish translation of all the app. This way with the first one I get all I have translated in 140 version, and with the second we avoid repeating common NAV translations, you know what I mean, “Posting date”, “Document No.”, “Item No.” “Location Code” and so on.
It is very important the sequence order you place previous translations files here. Next previous processed file will overwrite previous translations. The last previous file will overwrite all previous translations.
In this step, we create a excel plain text file, with the remaining expressions we have not translated in the previous steps.
"RemainigTranslationsFile": [
{"SkipStep": true},
{"Path": "C:/Users/Jesus/Documents/AL/WarehouseAssistant/ReminTrans.csv"}
If we open the file with excel you can see the columns. You can fill in B column your translations or write it with whatever tool you are using to automate the translation and save the plain excel text file.
When you finish the remaining translations of excel plain text with tabulations file, is time final .xlf file is made:
"FinalXlfFile": [
{"SkipStep": false},
{"Path": "C:/Users/Jesus/Documents/AL/WarehouseAssist
Here we only set the path of the final Spanish (or your local language) file. Remember don´t use in the .json file “\” patch separator use “/” instead. I will fix this little issue soon, but right now is what is. When you complete the set up you can type the run with F1 “JAM Process translation all steps”. You must be inside the .json file when you raise the command:
This command will perform all the four steps to get the final translation file. You can execute twice or n times if you need, as you manually translate the remaining captions.
With command "JAM Create a CSV file with all workspace translations", we create a file with all translation, for reviewing purposes. You must follow these steps:
- Execute command "JAM Create a CSV file with all workspace translations".
- Select the type of result file you want: source, target or both. source=captions in source language. target=captions translated. both=Umh....both, source and target.
- Select file destination.
Warning: translation steps must be executed before this exportation.
You can exclude some translations from the process, for example, if you don´t want to translate local country expressions, you can do it in the final of .json file, with the following step specification: "ExclusionsFromManual": []
- You only exclude these elements from the manual process, not from the final .xlf file. If there is a previous translation in any processed .xlf file, it will be included in the final .xlf file. The final target of this feature is to avoid translating not interesting local country elements.
- You can express exclusions with regular expressions, for example: report.* or with direct string expressions: “report”.
- Exclusions will be checked in all translate unit. That means, that the exclusion could be in the source, or in a xlf note inside the translation unit.
With command F2 “JAM Edit remaining translations with HTML view” you can edit the remaining translations in a HTML view. You can see the remaining captions in the source language, and you can edit the captions in the target language. With save button you can save the changes in the target language. App will display a file dialog to select your json translation steps file. You can set your styyle for HTML with configutation parameter "CSSHTMLTableView". Other way you have a default table style.
If in the previous translations the process detects the same source with multiple translations to target language, it warns you with a message and leaves all these translations in a file called MultipleTrans.json, for review purposes.
For this purpose, you only have to create a new .json file (Ctrl+N and save as any name with json extension in the workspace folder) and type new snippet JAMCreatetransfile.
Visual Studio ONLY.
This extension contributes the following settings:
TargetLanguage
: Set the target language code. Defaultes-ES
JSONTranslationFilename
: Set here if you like another file name for temp json object thanJSONTranslation.json
. Not needed.CSSHTMLTableview
: Set your CSS tableview for remaining translations editting.
Remember don´t use in the .json file “\” patch separator use “/” instead. I will fix this little issue soon, but right now is what is.
Initial release