Skip to content

feat(LC0091): report control and action translatable properties - #686

Merged
Arthurvdv merged 4 commits into
mainfrom
feat/lc0091-control-action-properties
Nov 26, 2026
Merged

Arthurvdv merged 4 commits into
mainfrom
feat/lc0091-control-action-properties

Conversation

@Arthurvdv

@Arthurvdv Arthurvdv commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Closes #683
Part of #668

Summary

LC0091 walked every flattened page control and action but checked only Caption, ToolTip and (controls) OptionCaption. The compiler writes a trans-unit for every property whose PropertyKindExtensions.IsTranslatableProperty() is true and recurses into the members (Translation/LabelWriterVisitor.cs DefaultVisit -> VisitSymbolWithProperties), so InstructionalText, AboutTitle and AboutText on controls and actions went unreported.

  • AnalyzePageLikeSymbol now loops over two static PropertyKind[] lists, the same way group A's PageLikeObjectPropertyKinds works: ControlPropertyKinds (Caption, ToolTip, OptionCaption, InstructionalText, AboutTitle, AboutText) and ActionPropertyKinds (Caption, ToolTip, AboutTitle, AboutText). GetProperty returns null for kinds a control or action does not declare.
  • Controls and actions added by page extensions and request page extensions already flow through AddedControlsFlattened / AddedActionsFlattened. Properties set in modify(...) blocks are out of scope (group D).
  • No ALCops.Common change: EnumProvider.PropertyKind already had InstructionalText, AboutTitle, AboutText.

SDK evidence (nav-sdk-source, Microsoft.Dynamics.Nav.CodeAnalysis.InternalSyntax/ObjectParser.cs, net10.0; net8.0 identical for these tables): field control InstructionalText :2543 (runtime 13.0), AboutTitle/AboutText :2584/:2600; group control InstructionalText :2676, AboutTitle/AboutText :2789/:2805; part control :3168/:3184; action :1869/:1885; action group :2074/:2090; custom action (GetPageCustomActionProperties, runtime 10.0) :5672/:5688; file-upload action (runtime 13.0) :5952/:5968. All runtime gates are below the 16.0 test floor.

Tests

Per item the empty-XLIFF HasDiagnostic, the Locked = true NoDiagnostic and the translated NoDiagnostic fixture (20 items, 60 files):

  • PageFieldControl{InstructionalText,AboutTitle,AboutText}
  • PageGroupControl{InstructionalText,AboutTitle,AboutText}
  • PagePartControl{AboutTitle,AboutText} (target page MyOtherPage declared in the fixture)
  • PageAction{AboutTitle,AboutText}, PageActionGroup{AboutTitle,AboutText}
  • PageCustomAction{AboutTitle,AboutText} (CustomActionType = Flow with FlowId/FlowEnvironmentId)
  • PageFileUploadAction{AboutTitle,AboutText} (trigger OnAction(Files: List of [FileUpload]))
  • PageExtensionControlAboutTitle (added field control), PageExtensionActionAboutText (added action)
  • RequestPageControlAboutTitle (field control), RequestPageActionAboutText (action)

Namespaced variant: NamespacePageControlAboutTitle / NamespacePageControlAboutTitleTranslated (group control, RequireMinimumVersion("18.0.38.52553", ...)).

New XLIFF constants TranslatedControlAndActionPropertiesXliffContent (20 units, helper CreateFixtureWithTranslatedControlAndActionPropertiesXliff, method NoDiagnosticTranslatedControlAndActionProperties) and NamespaceTranslatedPageControlAboutTitleXliffContent (method NoDiagnosticTranslatedControlAndActionPropertiesWithNamespaces). New HasDiagnostic / NoDiagnostic cases are added to the existing methods.

Trans-unit IDs were not computed by hand: each fixture (markers stripped, plus a Locked variant) was compiled as its own scratch app ("features": ["TranslationFile", "NoImplicitWith"], runtime 16.0, platform 29.0.0.0, System symbols only; runtime 18.0 + TranslationsWithNamespaces for the namespaced one) with the local al compile (AL 30.0.42.11883), and the <trans-unit id> values (including al-object-target for the page extension units) plus Xliff Generator notes were copied from Translations/TestApp.g.xlf. All fixtures compiled without errors or warnings; every Locked variant drops its unit. Page extension fixtures name the added control/action MyExtField / MyExtAction, because a same-module extension folds into Page MyPage - Control <name> and would otherwise collide with the page fixture's unit in the shared XLIFF.

The fixture commit (a3d5b43) failed before the analyzer change: 21 failures, all There is no issue reported for LC0091 (the 20 new HasDiagnostic cases plus NamespacePageControlAboutTitle); the Locked/translated cases passed.

Pinned-ID check: changing Page 2931038265 - Control 979848377 - Property 1064389655 to ...979848378... in the constant made NoDiagnosticTranslatedControlAndActionProperties("TranslatedPageExtensionControlAboutTitle") fail with Missing translation for 'AboutTitle' in language(s): da-DK (1 failed, 173 passed); reverted.

Deliberate non-reports found

  • None new. Every listed control/action kind compiles at runtime 16.0 and emits its unit. Properties in modify(...) blocks stay unchecked (group D).
  • Observation, not changed here: the compiler emits a Table MyTable - Field MyField - Property Caption unit for a table field with no declared Caption (missing-caption unit, source = field name). LC0091 only checks declared properties, so that unit is not reported.

Docs

.claude/rules/diagnostics/lc0091-translatable-text-should-be-translated.md: design decision (control and action property lists), SDK facts (per-kind control/action properties, runtime gates, Control/Action ID segments, same-module folding), test notes (fixture families, ID generation, distinct names in extension fixtures).

Companion docs PR: ALCops/alcops.dev#242

Verification

  • dotnet build ALCops.sln: 0 errors (pre-existing MSB3277 test-project warnings only)
  • dotnet test ALCops.sln: all passed (LinterCop 632, PlatformCop 784, ApplicationCop 634, FormattingCop 243, DocumentationCop 107, TestAutomationCop 30, Common 169)
  • LC0091 (net10.0): 174 passed, 0 failed
  • LC0091 against the net8.0 analyzer binary (GITHUB_ACTIONS=true dotnet test src/ALCops.LinterCop.Test -c Release -p:NavTargetFramework=net8.0 ...): 163 passed, 11 skipped (version-gated: namespace and page object ToolTip / analysis view cases), 0 failed
  • dotnet build src/ALCops.LinterCop/ALCops.LinterCop.csproj -c Release -p:ContinuousIntegrationBuild=true --no-incremental: netstandard2.1, net8.0, net10.0 built, 0 warnings, 0 errors (Common unchanged, so only LinterCop)
  • dotnet format ALCops.sln --verify-no-changes: exit 0
  • Validate-Rules.ps1: OK, 69 rules files pass all checks

🤖 Generated with Claude Code

Arthurvdv and others added 3 commits November 25, 2026 20:38
Fixtures for the control and action translatable properties LC0091 does
not report yet: field control InstructionalText, AboutTitle and
AboutText; group control InstructionalText, AboutTitle and AboutText;
part control, action, action group, custom action and file-upload action
AboutTitle and AboutText; plus a control and an action added by a page
extension, a request page control and action, and a namespaced group
control. The translated variants use trans-unit IDs generated by the AL
compiler.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…tructionalText

Page controls now check Caption, ToolTip, OptionCaption,
InstructionalText, AboutTitle and AboutText, and page actions check
Caption, ToolTip, AboutTitle and AboutText, each from one static list;
GetProperty returns null for the kinds a control or action does not
declare. This covers field, group and part controls and actions, action
groups, custom actions and file-upload actions on pages and request
pages, including the controls and actions a page extension adds,
matching the trans-units the compiler writes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… name lists

A request page extension exposes only added controls, not actions, so
the rule doc no longer claims both. The test notes keep the ID facts
(folding, segment names, name collisions) and leave the fixture names
to the test project.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@Arthurvdv
Arthurvdv merged commit 1ef9f62 into main Nov 26, 2026
54 checks passed
@Arthurvdv
Arthurvdv deleted the feat/lc0091-control-action-properties branch November 26, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(LC0091): control and action AboutTitle, AboutText and InstructionalText

1 participant