Repository navigation
feat(LC0091): report control and action translatable properties - #686
Merged
Merged
Conversation
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]>
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]>
This was referenced Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #683
Part of #668
Summary
LC0091 walked every flattened page control and action but checked only
Caption,ToolTipand (controls)OptionCaption. The compiler writes a trans-unit for every property whosePropertyKindExtensions.IsTranslatableProperty()is true and recurses into the members (Translation/LabelWriterVisitor.csDefaultVisit->VisitSymbolWithProperties), soInstructionalText,AboutTitleandAboutTexton controls and actions went unreported.AnalyzePageLikeSymbolnow loops over two staticPropertyKind[]lists, the same way group A'sPageLikeObjectPropertyKindsworks:ControlPropertyKinds(Caption,ToolTip,OptionCaption,InstructionalText,AboutTitle,AboutText) andActionPropertyKinds(Caption,ToolTip,AboutTitle,AboutText).GetPropertyreturns null for kinds a control or action does not declare.AddedControlsFlattened/AddedActionsFlattened. Properties set inmodify(...)blocks are out of scope (group D).ALCops.Commonchange:EnumProvider.PropertyKindalready hadInstructionalText,AboutTitle,AboutText.SDK evidence (
nav-sdk-source,Microsoft.Dynamics.Nav.CodeAnalysis.InternalSyntax/ObjectParser.cs, net10.0; net8.0 identical for these tables): field controlInstructionalText:2543 (runtime 13.0),AboutTitle/AboutText:2584/:2600; group controlInstructionalText: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, theLocked = trueNoDiagnosticand the translatedNoDiagnosticfixture (20 items, 60 files):PageFieldControl{InstructionalText,AboutTitle,AboutText}PageGroupControl{InstructionalText,AboutTitle,AboutText}PagePartControl{AboutTitle,AboutText}(target pageMyOtherPagedeclared in the fixture)PageAction{AboutTitle,AboutText},PageActionGroup{AboutTitle,AboutText}PageCustomAction{AboutTitle,AboutText}(CustomActionType = FlowwithFlowId/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, helperCreateFixtureWithTranslatedControlAndActionPropertiesXliff, methodNoDiagnosticTranslatedControlAndActionProperties) andNamespaceTranslatedPageControlAboutTitleXliffContent(methodNoDiagnosticTranslatedControlAndActionPropertiesWithNamespaces). NewHasDiagnostic/NoDiagnosticcases are added to the existing methods.Trans-unit IDs were not computed by hand: each fixture (markers stripped, plus a
Lockedvariant) was compiled as its own scratch app ("features": ["TranslationFile", "NoImplicitWith"], runtime 16.0, platform 29.0.0.0, System symbols only; runtime 18.0 +TranslationsWithNamespacesfor the namespaced one) with the localal compile(AL 30.0.42.11883), and the<trans-unit id>values (includingal-object-targetfor the page extension units) plusXliff Generatornotes were copied fromTranslations/TestApp.g.xlf. All fixtures compiled without errors or warnings; everyLockedvariant drops its unit. Page extension fixtures name the added control/actionMyExtField/MyExtAction, because a same-module extension folds intoPage 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 newHasDiagnosticcases plusNamespacePageControlAboutTitle); theLocked/translated cases passed.Pinned-ID check: changing
Page 2931038265 - Control 979848377 - Property 1064389655to...979848378...in the constant madeNoDiagnosticTranslatedControlAndActionProperties("TranslatedPageExtensionControlAboutTitle")fail withMissing translation for 'AboutTitle' in language(s): da-DK(1 failed, 173 passed); reverted.Deliberate non-reports found
modify(...)blocks stay unchecked (group D).Table MyTable - Field MyField - Property Captionunit for a table field with no declaredCaption(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/ActionID 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)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 faileddotnet 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 0Validate-Rules.ps1: OK, 69 rules files pass all checks🤖 Generated with Claude Code