Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Blogs / Jesús Almaraz blog / New translation files manag...

New translation files management extension

The “.xlf” files question

A little review about how translation works in AL applications:
  • Your start point is the AL application with names and captions in English.
  • When you build the .app file AL app generator build the .xlf translation file with the English language layer and English captions are written in these labels:
<source>Specifies the number of the involved entry or record, according to the specified number series.</source>
So, the remaining work is doing a .xlf in your native language, matching  the original source text with the target translation:
          <source>Specifies the cost of one unit of the item or resource on the line.</source>
          <target>Especifica el coste de una unidad del producto o recurso en la línea.</target>
There are some previous interesting tools to manage translations:
This other is very interesting NAB AL Tools - Visual Studio Marketplace
And

Our approach

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:
1.         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.
2.         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.
3.         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
4.         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.

The new extension

We made a VSCode extension to manage translation driven by a json file to do these four steps.
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:
6403.Snipet.png
The set of each step must be filled the way is described below.

Step 1

    "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:
5554.Al-pack.png
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.

Step 2

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.

Step 3

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.
5353.Excel.png

Step 4

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/WarehouseAssistant/Translations/WarehouseAssistant.ES.xlf"}
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:
2746.BeginSteps.png
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.

Disclaimer

Notice that it is a Beta. I am working with these tools since months ago, but not with this version “all steps executer”.

Comments

*This post is locked for comments