Working with Translation Files (XLIFF)

by Sep 13, 2021AL 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

Exploring CosmosDB with Business Central, part 2

Exploring CosmosDB with Business Central, part 2

This part explains how to connect to Azure Cosmos DB from your Business Central extension using AL Language and how to get some values from the database.------------------------------------------------------------------------------------------------------------------...

read more
DynamicsCon 2021 session recording available!

DynamicsCon 2021 session recording available!

Finally, recordings from DynamicsCon 2021 Autumn edition are available! Check the official youtube channel. It was a great conference with over 250 people during my live session! I definitely hope I will be able to attend the next in-person DynamicsCon as a speaker...

read more
Directions EMEA day 0 ;)

Directions EMEA day 0 😉

Directions4Partners EMEA 2021 is still in progress here in Milan. I want to share all details about each day, but unfortunately, there are so many amazing things to see, watch and try I have almost no time. So today just a few words about the day before the...

read more
ErrorInfo data type & Collectible Errors

ErrorInfo data type & Collectible Errors

A major change to AL Language development is here! Collectible errors can hugely improve any validation procedures. And what's new? Everything is about a new data type ErrorInfo. ErrorInfo data type ErrorInfo is a new data type introduced in Microsoft Dynamics 365...

read more
Custom Filter Tokens

Custom Filter Tokens

As a user of the Business Central you have some constants you can use to filter or insert values. These constants contain useful values for data manipulation such as t / today for date field - return current dateq / quarter for date field filters - return range of the...

read more
Field Level Permissions (Restricted Fields)

Field Level Permissions (Restricted Fields)

I just add a new project to my GitHub repositories. It is a new extension for Business Central that extends security functionalities with field-level permission. Using this extension, users are able to define who can or can not change specific fields in any table in...

read more
How to let users choose field(s) properly

How to let users choose field(s) properly

When some complex functionality is developed, it is sometimes necessary to let users choose a specific field. This can be required for field permissions, mapping imported values or any similar process. Earlier, the usual way was to create a link on the Field table...

read more