Business Central Translations: Working with XLIFF Files - Part 2 - CloudFronts

Business Central Translations: Working with XLIFF Files – Part 2

By the end of this guide, you will be able to generate, edit, and implement XLIFF files in Microsoft Dynamics 365 Business Central to support multiple languages seamlessly. This will enable your application to display translated content for UI labels, reports, and messages, ensuring a smooth experience for users across different regions.

Why does this matter?

Using XLIFF files, businesses can easily localize Business Central applications without modifying source code, making multilingual support efficient and scalable. By leveraging tools like NAB AL Tools, translations can be managed effortlessly, enhancing global usability.

Generating an XLIFF File

To illustrate the XLIFF process, let’s go through an example where we add a custom field named “Custom_Field” on the Customer Card page.

Step 1: Creating a Custom Field

First, we create a new field, Custom_Field, on the Customer Card page using AL code:

Step 2: Enabling Translation File Feature

In the app.json file, ensure that the TranslationFile feature is enabled:

Step 3: Building the Project

Now, build the extension using the shortcut CTRL + Shift + B. This will generate an .xlf file automatically in the translation folder. By default, the file is generated in English (en-US).

Using NAB Extension for Translation

To simplify translation tasks, you can install the NAB AL Tools extension from the Visual Studio Code marketplace. This extension helps in managing translation files efficiently by allowing automated translation suggestions and quick file updates.

Steps to Use NAB AL Tools:

A) Install NAB AL Tools.

B) Press CTRL + Shift + P and select NAB: Create translation XLF for new language.

C) Enter the language code (e.g., fr-FR for French – France).

D) Choose Yes when prompted to match translations from BaseApp.

E) A new fr-FR.xlf file will be generated.

Translating the XLIFF File

To translate the XLIFF file into another language (e.g., French), follow these steps:

  • Open the generated .xlf file.
  • Modify the target-language attribute in the XLIFF file to fr-FR.
  • Translate the required text elements under the <target> tag.

Example:

Translating Report Labels

In Business Central RDLC reports, hardcoded text values can also be translated using labels. Instead of writing static text, define labels within the AL code:

Using FieldCaption ensures that report labels dynamically adapt to the selected language, improving localization without manual modifications.

When switching languages, the label automatically retrieves the corresponding translation from the XLIFF file.

Modifying Standard Fields

Standard field names in Business Central can also be modified using the BaseApplication.g.xlf file. You can find this file in public repositories, such as:

BaseApplication.g.xlf

Modifying this file allows changes to default field captions and system messages in multiple languages.

Insert value in different languages via AL

In Microsoft Dynamics 365 Business Central, AL enables efficient multilingual data handling.

The image above illustrates a Customer Card where the “Nom” (Name) field contains the value “testing.” The AL code extends the Customer table, adding a custom field and an onInsert trigger to validate the Name field with “testing.”

This ensures data consistency across different language settings. By leveraging AL, developers can automate multilingual field values, enhancing Business Central’s global usability.

To conclude, managing translations in Business Central using XLIFF files enables businesses to support multiple languages efficiently. By generating XLIFF files, modifying them for translation, and leveraging tools like NAB AL Tools, businesses can ensure accurate and seamless localization.

For further refinements, modifying report labels and system fields enhances multilingual support, improving the user experience across global deployments.

We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange