Translation in AL Guide

Guidelines for Partners

1. Introduction | Translation in AL

Translation in Dynamics NAV24 (Business Central) refers to the process of adapting the user interface, system messages, and custom extensions to support multiple languages. This allows users in different regions to work in their preferred language while maintaining consistent functionality. This page lists the countries/regions where Dynamics 365 Business Central is available and which languages are supported. Country/regional availability and supported languages.

In Dynamics 365 Business Central, this is done using XLIFF files, which is a standardized format used for computer-based translations.

If you are not familiar with XLIFF files, there is a great intro about working with translation files on Microsoft Learn.

2. Translation file

To add a new language to the extension that you have built, you must first enable the generation of XLIFF files. The XLIFF file extension is .xlf. The generated XLIFF file contains the strings that are specified in properties such as Caption, CaptionML, and Tooltip. Once the XLIFF file is generated, it serves as a template for localization, allowing you to define translations for various languages.

The file follows a structured XML format that maps source strings to their corresponding translations. By editing the XLIFF file, you can provide translations for each string and specify the target language. After adding the translations, the updated XLIFF file can be imported back into the system, enabling the extension to display localized text to end-users.

3. Steps to Generate XLIFF Files

1. Enable Translation File Generation:

  • In your app.json file add the following line:
    Translation file

 

2. Build and publish your application:

  • Build the Al project to generate XLIFF file.
  • The .xlf file will be created in the /Translations folder of your project.

 

 

 

3. Make translations:

  • You get a translation file that looks like this:

Translation in AL

4. Adding a new language

To add a new language:

1. Copy and rename the generated XLIFF file in the /Translations folder.

2. Modify the target-language attribute to the desired language code. For example, for Lithuanian (lt-LT):
XLIFF

 

3. Add translations in the <target> element for each <trans-unit>.
Translation in AL

 

 

Translation in AL

<note> elements provide metadata for the translation. Two notes are present:

From “Developer”:

  • This note likely contains a message from the developer, providing additional details or priority for translators.
  • Priority 2 suggests moderate importance.

From “Xliff Generator”:

  • This note provides technical context about the string’s origin, helping translators understand where the string appears in the system.
  • In this case:

Table Fine Lines: Indicates that this string originates from a table called “Fine Lines.”

Field Data of Issuing the Fine: Specifies that the field in translation is “Data of Issuing the Fine.”

Property Caption: Indicates that the string is used as a caption for the field.

If the amount of text is very large, manual editing can be time-consuming.

If you have a larger solution, it is recommended to use the Visual Studio Code extension XLIFF Sync for all translation-related procedures. This tool simplifies and automates the translation process, making it more efficient to manage large files.

5. Simplifying Translation with NAB AL Tools Extension

To make translation tasks more efficient and convenient in Dynamics 365 Business Central, you can leverage the NAB AL Tools extension in Visual Studio Code.

NAB AL Tools

Here’s how you can use its features step by step:

 

Accessing NAB AL Tools Functions

1. Open Command Palette:

  • Press F1 (or Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS).

2. Search for NAB Commands:

  • Type “NAB” in the Command Palette.
  • You’ll see a list of available commands provided by the NAB AL Tools extension.

NAB AL

 

 

 

 

 

 

 

 

 

 

 

 

Here are some commonly used and helpful commands for translation management:

1. NAB: Create XLIFF File for Translation:

  • Automatically generates the .xlf file for your AL project.
  • The file is created in the /Translations folder of your project.

2. NAB: Validate Translations:

  • Checks your XLIFF files for missing translations, invalid formats, and other errors.
  • Ensures that your translations meet Business Central’s requirements.

3. NAB: Sync Translations:

  • Synchronizes XLIFF files with your AL source code.
  • Updates translations to reflect changes made to captions or tooltips in the code.

4. NAB: Export Translations to Excel:

  • Exports the XLIFF file content to an Excel sheet for easier bulk editing of translations.

5. NAB: Import Translations from Excel:

  • After editing translations in Excel, this command allows you to import them back into the XLIFF file.

6. NAB: Translate with Machine Translation:

  • Integrates with translation services (e.g., Google Translate or Azure Translator).
  • Automatically suggests translations for strings in the XLIFF file.

7. NAB: Find Untranslated Text:

  • Highlights and navigates to untranslated strings in the XLIFF file.
  • Helps ensure all captions and tooltips are localized.

 

Quick Tips

  • Shortcut Navigation:

You can directly navigate to untranslated strings or specific trans-unit tags in the XLIFF file by using NAB AL Tools’ navigation features.

NAB AL

 

 

 

 

 

  • Customizing Translations:

Right-click on an XLIFF string and use NAB-specific context menu options to translate or validate it.

  • Consistency Checks:

After syncing translations, always validate them using NAB: Validate Translations to avoid deployment issues.

By integrating NAB AL Tools into your workflow, you can streamline the entire translation process, from generating XLIFF files to validating and finalizing localized text. This makes managing multilingual support in AL projects much more convenient and efficient.

6. Conclusion | Translation in AL

Localization is an essential component of creating intuitive and accessible applications in Dynamics 365 Business Central. Utilizing XLIFF files and tools like NAB AL Tools empowers developers to streamline the translation process, ensure consistency, and minimize errors. These tools simplify the management of multilingual support, enabling developers to deliver high-quality, localized solutions that enhance the user experience across diverse regions and languages.