Locked Label must have a suffix Tok (AC0021)
A label with the Locked property set to true is explicitly marked as non-translatable and represents a hardcoded value. To make this intent explicit and consistent, locked labels must be suffixed with ‘Tok’.
This naming convention helps developers immediately recognize that a label contains a technical value that should not be translated, improving code readability and maintainability.
Note: This rule is disabled by default. Enable it in your project’s .editorconfig or ruleset file if you want to enforce the ‘Tok’ suffix convention for all locked labels.
Example
The following locked label does not have the ‘Tok’ suffix:
codeunit 50100 MyCodeunit
{
var
ApiVersion: Label 'v1.0', Locked = true; // Label 'ApiVersion' has the Locked property set to true but is not suffixed with 'Tok'. [AC0021]
}
To fix this, add the ‘Tok’ suffix:
codeunit 50100 MyCodeunit
{
var
ApiVersionTok: Label 'v1.0', Locked = true;
}