Working with Translation Files (XLIFF)

by Jan 29, 2022AL Language

Home 9 Development 9 AL Language 9 Working with Translation Files (XLIFF)

How does the translation file work?

In Microsoft Dynamic 365 Business Central, displaying different languages is done using the XLIFF files extension (.xlf). The generated XLIFF files have strings that are specified in properties like Captions, Tooltips…

!!!Important!!!

———————

Old multilanguage properties (SomethingML like ToolTipML, CaptionML, …) are deprecated and are not supported by the Translation Files!

To enable translation files, the TranslationFile flag must be specified in the app.json

  “features”: 

      [ 
"TranslationFile"
]

To generate an XLIFF file, you should run the build command (Ctrl+Shift+B) in the Visual Studio Code. When you do this, the /Translation folder will pop, containing the .xlf files. The .xlf files will have all the labels, label properties, and reports of the labels you are using in the extension. Thus, by using the .xlf file, you will translate the data.

How to generate caption based on object names?

To generate the captions based on the object name, you must set the GenerateCaptions flag found in the app.json file. Once you do this, you will have to specify how you want to generate the caption.

You can choose to base it on the pages, tables, XMLports, reports, request pages, and table fields. If the object has the Caption properly set, the value used for table fields the OptionCaption is used for.

The system used to generate captions is

  "features": 
[
"TranslationFile",
"GenerateCaptions"
]

Create specific translation

The automatically created XLIFF file (created from build command) can be translated to your language manually or using any tool for reading/modifying translation files (or send it to your translation service as XLIFF is the most-known and most-used file format for translations).

Once you are done with the translation, you need to move the translated file to the same directory as the original translation file. Do not forget to rename the new file! That will help you avoid the possibility of the file getting overwritten the next time you build an extension.

AppSource

All applications you want to upload to AppSource must use Translation files!

Recent Articles from the category

Dynamics NAV 2013 & Expired Cronus License

Dynamics NAV 2013 & Expired Cronus License

We found an interesting problem - we were not able to run the development environment for Dynamics NAV 2013. Whenever we tried to run the development client, we got the following error message: "Your program license has expired" and the development client has closed...

read more
Indirect Dependencies and Access Modifiers

Indirect Dependencies and Access Modifiers

Last week, there was a discussion on Yammer on how to get values from the "Sent Email" record when all fields are marked as Internal. I was surprised that many people do not know what can/can't access modifiers (such as local, protected, or internal) be used for. I...

read more
AL Extensions: Replace Document Attachment

AL Extensions: Replace Document Attachment

I have published a new simple, open-source extension that allows replacing existing document attachments in all master entities as well as in open documents. The source code as well as the app file that can be installed in your environment is available on my GitHub...

read more
Clean up your copied environments

Clean up your copied environments

One of the most important things every developer should handle is to clean up the environment when the environment (or a company) is copied. Especially if the environment is managed directly by a client and they can create new copies anytime. Similarly, for copied...

read more
7 git commands you should know

7 git commands you should know

For many years, developers in C/AL did not need to know anything about Git or other versioning tools. That has changed with Business Central, or more specifically with AL Language. Today, we will look at the most important (and basic) git commands any developer should...

read more
How to define the source for item reservations?

How to define the source for item reservations?

It's not uncommon to have a customer's request to limit from which source items could be reserved. For example, customers may not want to reserve items from return orders. How can we achieve this goal? It's really simple. All the magic is done in the procedure...

read more
NavigationAction for ErrorInfo data type

NavigationAction for ErrorInfo data type

One more article about ErrorInfo data type. Have you already read my previous posts about ErrorInfo and Collectible Errors? ErrorInfo data type & Collectible Errors | MSDyn365 Business Central - Ing. Tomáš Kapitán (kepty.cz) Collectible Errors?! | MSDyn365...

read more

Sign Up for News

Certifications

Highest certification
Microsoft Data Management and
also in D365 Business Central

Microsoft Certified: Dynamics 365 Business Central Functional Consultant Associate

See other certifications here