Creating multi language captions with XLIFF file is officially well documented below

Working with Translation Files - Business Central | Microsoft Docs

 

One very specific remark that everyone should know is that up to now (March 2021):

an extension that implements only an XLIFF file (so called Translation App) is processed as last one in the dependency order.

 

What does this mean in practice?

Let’s consider some real-life scenario: PromotedActionCategories with Service Item Card.

Below the characteristics / rules for this scenario:

  1. PromotedActionCategories do have XLIFF file inside the Base Application, if this is a first party localized one (e.g. NL, DE, ES, IT, etc.)
  2. PromotedActionCategories can be translated in translation apps (e.g. NL translation app, DE translation app, etc.) on top of W1 base application.
  3. PromotedActionCategories could be extended by 3rd party app
  4. Extended PromotedActionCategories could/should be translated by 3rd party

 

So far so good.

Once you know the rule, you know how to work with these.

 

FIRST SCENARIO: EXTENDING LOCALIZED BASE APPLICATION

This should be the easiest case. Since XLIFF file is contained in the Base Application, it is only needed to reference the base application in the app.json for the 3rd party extension

 

  "dependencies": [],

  "application": "17.0.0.0",

 

together with the page extension that extend the promoted categories

 

    PromotedActionCategories = 'New,Process,Report,Navigate,Item,CustomPromCat';

 

and XLIFF file that translate these (note the original attribute whom is referring to the current extension)

 

  <file datatype="xml" source-language="en-US" target-language="nl-NL" original="PromotedCategoriesExtension">

 

          <source>New,Process,Report,Navigate,Item,CustomPromCat</source>

          <target state="translated">Nieuw,Verwerken,Rapporten,Navigeren,Artikel,CustomPromCat</target>

 

Below a graph how extensions will be deployed and translation applied in this case

 

 

SECOND SCENARIO: EXTENDING W1 BASE APPLICATION

This gets a bit more complicated since the rules are:

  1. Localized XLIFF file is contained in a translation app
  2. an extension that implements only an XLIFF file (so called Translation App) is processed as last one in the dependency order.

 

If we decide to deploy the previous extension, that includes XLIFF file within the same extension, the result would be that translation app will be deployed last and override translations contained in the extension.

To appropriately resolve this problem and have the translation working as expected, it is needed to separate the development extension from the translation extension.

 

The development extension (PromotedCategoriesExtension) could only contain the extended promoted categories

 

    PromotedActionCategories = 'New,Process,Report,Navigate,Item,CustomPromCat';

 

And NO XLIFF file (or XLIFF file that contains translation ONLY for newly added objects within the same extension original="PromotedCategoriesExtension and not the ones that extends objects or properties for whom there might be external translation apps).

Even the extension from the previous scenario would work just fine for this purpose.

 

The translation extension (TranslatePromotedCategoriesExtension) should add dependency to both base application and other (typically 1st ) party translation extension

 

  "dependencies": [

    {

      "id": "499ec319-ef73-463a-8d31-d66a58e2325a",

      "name": "Dutch language (Netherlands)",

      "publisher": "Microsoft",

      "version": "17.0.0.0"

    }

  ],

  "application": "17.0.0.0",

  

And only contains the translation for the PromotedCategories referencing the base application as the origin (see original attribute)

 

  <file datatype="xml" source-language="en-US" target-language="nl-NL" original="Base Application">

 

          <source>New,Process,Report,Navigate,Item,CustomPromCat</source>

          <target state="translated">Nieuw,Verwerken,Rapporten,Navigeren,Artikel,CustomPromCat</target>

 

Below a graph how extensions will be deployed and translation applied in this case