Translate your app with an LLM, what?

For years, I have used “Azure Translator in Foundry Tools” for translating our apps. Great translations, but lacking context, so a few months back, I switched my process to use LLMs for translations with much better results. Check out the video:

https://youtu.be/fWBehdiuDpE

ALBuild can be found here: https://github.com/hougaard/albuild-opensource


In this video, Erik demonstrates how to use an LLM (Large Language Model) like Claude or ChatGPT to translate Business Central AL extensions — producing significantly better translations than traditional machine translation services, with the added benefit of context-aware translation through system prompts and label comments.

The Problem with Traditional Translation

Erik publishes apps used worldwide and has been supplying translations as part of his build pipeline for five to six years. The original approach used Azure Translator (formerly Microsoft Cognitive Services Translation) integrated into the AL Build Tool. While functional, the results were often questionable — Erik would occasionally hear from users who encountered bizarre translations in their localized versions of the apps.

The challenge is clear: manually translating thousands of texts into languages like German isn’t feasible for most developers, but traditional machine translation lacks the domain-specific context needed for professional business software.

Setting Up Translation in Business Central

Before any translation can happen, you need to enable translation file generation in your app.json. The key setting is the "features" array with "TranslationFile":

{
  "id": "58e6ab59-4994-44c7-90de-4bb8361cf0e6",
  "name": "apptranslation",
  "publisher": "Default publisher",
  "version": "1.0.0.0",
  "brief": "",
  "description": "",
  "privacyStatement": "",
  "EULA": "",
  "help": "",
  "url": "",
  "logo": "",
  "dependencies": [],
  "screenshots": [],
  "platform": "1.0.0.0",
  "application": "19.0.0.0",
  "idRanges": [
    {
      "from": 50100,
      "to": 50149
    }
  ],
  "resourceExposurePolicy": {
    "allowDebugging": true,
    "allowDownloadingSource": false,
    "includeSourceInSymbolFile": false
  },
  "features": ["TranslationFile"],
  "runtime": "8.0"
}

With this enabled, compiling your app generates an XLIFF translation file. However, only Label types are included — plain strings are not translatable. So your translatable text needs to be declared as a label:

pageextension 50102 CustomerListExt extends "Customer List"
{
    trigger OnOpenPage();
    var
        ToTranslate: Label 'This message can be translated.', Comment = 'This is a comment';
    begin
        Message(ToTranslate);
    end;
}

When you compile, the generated .g.xliff file will contain translation units with a source element but no target — that’s where the LLM translation tool comes in.

How the LLM Translation Pipeline Works

Erik’s tool, AL Build, is a Python-based executable that can run locally, in a GitHub runner, or any CI/CD agent. It’s driven by a JSON configuration file that defines a series of tasks:

  1. Update the version — so each build produces a unique app file
  2. Register the app — reads the app.json to know the app name, publisher, and other metadata
  3. Compile — builds the AL app and generates the XLIFF file
  4. Translate — sends the XLIFF file to the LLM with a system prompt for context

The translation task takes two critical inputs: the path to the .g.xliff file, and a system prompt that provides context. For example:

“This is an app for Business Central. It’s adding extended functionality to common finance areas. The target user is a finance controller that speaks fluent finance.”

This system prompt is the key differentiator from traditional translation. By telling the LLM who the audience is and what domain the app operates in, the translations come back with appropriate terminology and tone.

Caching and Microsoft Translations

Erik built a smart caching layer into the tool. When the LLM translates something, the result is stored in a local database. On subsequent runs, if the source text hasn’t changed, the cached translation is used — saving both time and token costs.

Even more clever: Erik has pre-loaded all of Microsoft’s official Business Central translations into the database. So if your app uses a caption like “Customer No.” — a standard Microsoft label — the tool will use Microsoft’s approved translation instead of generating a new one:

table 50101 "Translate example"
{
    fields
    {
        field(1; CustomerNo; Code[20])
        {
            Caption = 'Customer No.';
        }
    }
}

This approach reduces the number of potentially incorrect translations and ensures consistency with the base application. As Erik puts it: “If we’re translating something wrong, we’re doing it as wrong as Microsoft did.”

Using Label Comments for Per-Text Translation Instructions

One of the most powerful features of this approach is the ability to pass per-label translation instructions through the AL Comment property. In standard AL development, the Comment property on a label has no runtime effect — it’s metadata that goes into the XLIFF file as a “note from the developer.”

But when an LLM is processing the translations, that comment becomes an instruction. Erik demonstrates this with a playful example — adding a comment that says “This should be translated with pirate talk” — but the real-world applications are far more practical:

  • Explain the broader context of a label (e.g., “This appears on a confirmation dialog before posting a journal”)
  • Specify the function or flow the text is part of
  • Clarify ambiguous terms (e.g., “Post here means to submit/finalize, not mail”)
  • Indicate the purpose and audience for a specific message

The XLIFF file carries these comments as developer notes, and the LLM uses them as additional context when generating translations — producing more accurate, domain-appropriate results.

LLMs Writing Code with Translation Context

Erik points out an exciting implication: as developers increasingly use LLMs to write AL code, they can instruct the code-generating LLM to always include meaningful Comment properties on labels. These comments would describe the broader context — what the function does, the purpose of the text, and the user flow. This creates a virtuous cycle where AI-generated code is pre-annotated for AI-powered translation, resulting in better localized apps with minimal human intervention.

Conclusion

LLM-powered translation represents a significant improvement over traditional machine translation for Business Central apps. The combination of system-level context prompts, per-label developer comments, cached translations, and Microsoft’s official translation database produces results that are more natural, domain-appropriate, and consistent. The tool — AL Build — is open source, so you can try it out, customize it, or contribute to it. Check the links in the video description to get started.