Skip to content

al_writetranslation: where should the .xlf land when targetLanguage is not a plain culture code? #8375

Open

Description

While testing the AL MCP tools I ran into some file-placement behavior in al_writetranslation that I could not find documented, and I would like to understand what is expected.

I called al_writetranslation with a targetLanguage value that contained dot segments instead of a clean culture code, and the tool created the .xlf outside the project's Translations folder ÔÇö it ended up one directory above the project.

The call (through the MCP server started with altool launchmcpserver):

  • parameters.transUnitId: "Table 50100 - Field 1 - Property Caption"
  • parameters.targetLanguage: "........\da-DK-MK2413"
  • parameters.sourceText: "hello"
  • parameters.targetText: "hej"
  • parameters.appName: "Marker"

The tool responds with success (filePath "Translations/Marker.........\da-DK-MK2413.xlf"), and the file really is created above the project folder. The Translations folder itself stays empty.

Is that expected? Where are translation files supposed to go when the locale code is not a plain culture like da-DK? Are locale strings with separators supposed to be validated or sanitized before they are used in the file name? I could not find the file-naming rules documented anywhere.

edited by Thaddeus Loke (@thloke) to consolidate with #8376:

Following up on #8375 with the exact MCP client request/response pair, since the automated triage run there could not get the tool past "transUnitId is required". I found why: that message is what you get when the arguments are sent flat. The tool's own tools/list schema advertises a single parameters object property, and once the arguments are wrapped that way the call goes through ÔÇö and the file-placement question from #8375 stands.

The request my client sends (JSON-RPC over stdio, server started with altool launchmcpserver, AL Development Tools 30.0.44.47290-beta):

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"al_writetranslation","arguments":{"parameters":{"transUnitId":"Table 50100 - Field 1 - Property Caption","targetLanguage":"..\\..\\..\\..\\da-DK-MK2413B","sourceText":"hello","targetText":"parent folder marker","appName":"Marker"}}}}

and the server replies:

{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text","text":"{\"success\":true,\"filePath\":\"Translations/Marker...\\\\..\\\\..\\\\..\\\\da-DK-MK2413B.xlf\",\"fileCreated\":true,\"transUnitCreated\":true,\"message\":\"Created translation in Marker...\\\\..\\\\..\\\\..\\\\da-DK-MK2413B.xlf (new file).\"}"}]}}

With the wrapper in place the tool reports success and the .xlf is created a level above the project folder (for me: <parent-of-project>\\da-DK-MK2413B.xlf), with the Translations folder left empty. A control call with a plain da-DK in the same wrapper lands in Translations/Marker.da-DK.xlf as expected, so it is specifically the dot-segment locale value that moves the file.

Two questions, same as before but now with a pair that actually exercises the write path: is the parent-folder placement intended for locale strings containing path segments, and should such values be rejected or normalized before the file name is built? The locale value also ends up verbatim in the file name and in the target-language attribute of the written file.

  • AL Development Tools: 30.0.44.47290-beta (dotnet tool install --prerelease)

Internal work item: AB#658308

Activity

  1. thloke commented on Nov 9, 2026

    @thloke
    Contributor

    Accepting, with the intended fix being to just reject any invocations that are anything but locale names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions