From db26f8d3be4763a58e98d5aedf7576fde0be30cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Sep 2026 11:01:07 +0000 Subject: [PATCH] knowledge: improve review precision from BCApps PR 10312 feedback --- .../style/label-locked-for-non-translatable.good.al | 5 +++++ .../knowledge/style/label-locked-for-non-translatable.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/microsoft/knowledge/style/label-locked-for-non-translatable.good.al b/microsoft/knowledge/style/label-locked-for-non-translatable.good.al index 02b35d9..d19a5f0 100644 --- a/microsoft/knowledge/style/label-locked-for-non-translatable.good.al +++ b/microsoft/knowledge/style/label-locked-for-non-translatable.good.al @@ -5,4 +5,9 @@ codeunit 50204 "Sample Locked Label Good" ContentTypeJsonTok: Label 'application/json', Locked = true; ApiBaseUrlTok: Label 'https://api.contoso.com/v1', Locked = true; TelemetryStartTxt: Label 'Operation started for %1.', Locked = true; + // Seeded VAT Bus. Posting Group default code: intentionally NOT locked. + // Each localization layer ships its own translated code and creates the + // matching master-data record with that same translated code, so + // translating this Label does not break the lookup. + XDomesticTxt: Label 'DOMESTIC'; } diff --git a/microsoft/knowledge/style/label-locked-for-non-translatable.md b/microsoft/knowledge/style/label-locked-for-non-translatable.md index 77f054b..40ee1a4 100644 --- a/microsoft/knowledge/style/label-locked-for-non-translatable.md +++ b/microsoft/knowledge/style/label-locked-for-non-translatable.md @@ -24,3 +24,7 @@ See sample: `label-locked-for-non-translatable.good.al`. `HttpsUrl: Label 'https://example.com';` or `ContentTypeTok: Label 'application/json';` declared without `Locked = true`. The translator localizes them, the integration fails in production for the affected tenant, and the failure is invisible in the developer's English-locale tests. See sample: `label-locked-for-non-translatable.bad.al`. + +## Exception: seeded master-data codes (e.g. posting group codes) + +Do not flag a Label as needing `Locked = true` just because its value is later written into a `Code` field with a `TableRelation`, such as `Default VAT Bus. Posting Group`, `Gen. Bus. Posting Group`, or a dimension code. Across the codebase (see `DemoTool` install/upgrade codeunits per country layer), seed values like `DOMESTIC` are declared as ordinary translatable Labels on purpose: each localization layer/company ships its own translated code, and the matching master-data record (e.g. the `VAT Business Posting Group`) is created with that same translated code in the same locale. Because creation and lookup happen together in the same tenant language, translating the code does not break referential integrity. Locking such a Label would instead diverge it from the localized master data it is meant to match. Only require `Locked = true` when the string crosses a locale boundary on its own (URLs, HTTP verbs, JSON/XML/API contract literals, GUIDs) — not for domestic seed/default codes that are created and consumed within the same tenant.