Repository navigation
feat(LC0091): report object-level translatable properties - #685
Merged
Merged
Conversation
Fixtures for the object-level translatable properties LC0091 does not report yet: page InstructionalText, PromotedActionCategories, AdditionalSearchTerms, EntityCaption, EntitySetCaption, AboutTitle and AboutText; request page InstructionalText, AboutTitle and AboutText; query EntityCaption, EntitySetCaption, AboutTitle and AboutText; report AdditionalSearchTerms; profile ProfileDescription; plus the page extension, page customization and profile extension variants. The translated variants use trans-unit IDs generated by the AL compiler. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Page-like objects now check every object-level translatable property from one static list (Caption, ToolTip, InstructionalText, AdditionalSearchTerms, EntityCaption, EntitySetCaption, PromotedActionCategories, AboutTitle, AboutText); GetProperty returns null for the kinds an object does not declare. Reports add AdditionalSearchTerms, profiles and profile extensions add ProfileDescription, and page customizations are checked for their object-level properties, matching the trans-units the compiler writes. Adds the missing EnumProvider.PropertyKind members. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Nov 25, 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 #682
Part of #668
Summary
LC0091 reported only the object-level
Captionand the page/report objectToolTip. The compiler writes a trans-unit for every property whosePropertyKindExtensions.IsTranslatableProperty()is true (Translation/LabelWriterVisitor.cs:51DefaultVisit->VisitSymbolWithProperties, loop at:229-240), so the other object-level translatable properties went unreported.AnalyzePageLikeSymbolnow loops over a staticPropertyKind[](Caption,ToolTip,InstructionalText,AdditionalSearchTerms,EntityCaption,EntitySetCaption,PromotedActionCategories,AboutTitle,AboutText) through a smallReportPageLikeObjectPropertieshelper;GetPropertyreturns null for kinds an object does not declare.AdditionalSearchTermsforReport;ProfileDescriptionforProfileandProfileExtension(newly registered;Captionis reported through the existing fall-through call).PageCustomizationis newly registered and checked for its object-level properties only (the compiler emitsPageCustomization <hash> - Property <hash>units forPromotedActionCategories,AboutTitle,AboutText). Its controls/actions are not walked (modify blocks are group D).EnumProvider.PropertyKindgainsAdditionalSearchTerms,EntityCaption,EntitySetCaption,InstructionalText,ProfileDescription,PromotedActionCategories(Common change, so all six cops were release-built for three TFMs).SDK evidence (
nav-sdk-source, net8.0):InternalSyntax/ObjectParser.csproperty tables at 1205, 1416, 1485, 1504, 1511, 1607, 1623 (page), 4347, 4485, 4501 (request page), 518, 525, 545, 557 (query), 4020 (report), 6516 (profile);LabelWriterVisitor.ShouldBeArtificiallyGenerated(:276-283) synthesizesPromotedActionCategoriesonly below ActionsV2 (10.0) when the property is absent;Emit/ExtensionObjectFoldingUtilities.GetTranslationRootSymbolfolds same-module page/profile extensions into their target and leaves customizations as their own root.Tests
Per item the empty-XLIFF
HasDiagnostic, theLocked = trueNoDiagnosticand the translatedNoDiagnosticfixture (25 items, 75 files):PageObject{InstructionalText,PromotedActionCategories,AdditionalSearchTerms,EntityCaption,EntitySetCaption,AboutTitle,AboutText},PageExtensionObject{InstructionalText,PromotedActionCategories,AdditionalSearchTerms,AboutTitle,AboutText},PageCustomizationObject{PromotedActionCategories,AboutTitle,AboutText},RequestPageObject{InstructionalText,AboutTitle,AboutText},QueryObject{EntityCaption,EntitySetCaption,AboutTitle,AboutText},ReportObjectAdditionalSearchTerms,ProfileObjectDescription,ProfileExtensionObjectDescription. Namespaced variant:NamespacePageObjectAboutTitle/NamespacePageObjectAboutTitleTranslated.New XLIFF constants
TranslatedObjectPropertiesXliffContent(19 units, methodNoDiagnosticTranslatedObjectProperties) andNamespaceTranslatedPageObjectAboutTitleXliffContent(methodNoDiagnosticTranslatedObjectPropertiesWithNamespaces).Trans-unit IDs were not computed by hand: each fixture (markers stripped, plus a
Lockedvariant) was compiled as its own scratch app ("features": ["TranslationFile"], runtime 16.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 plusXliff Generatornotes were copied fromTranslations/TestApp.g.xlf. The same compiles confirmed that everyLockedvariant drops the unit and that no fixture needs a gate above the 16.0 floor.The fixture commit (12964ef) failed before the analyzer change: 26 failures, all
There is no issue reported for LC0091(the 25 newHasDiagnosticcases plusNamespacePageObjectAboutTitle); theLocked/translated cases passed.Deliberate non-reports found
reportextension:InstructionalText,AboutTitle,AboutTextinside a report extension'srequestpagefail with AL0124, so there is nothing to report (the issue table listed them as extension-modifiable).Change Category_<name> - Property Captionunits the compiler synthesizes fromPromotedActionCategorieson page extensions and page customizations (seen at runtime 16.0) and on pages below runtime 10.0: no declaration of their own; thePromotedActionCategoriesproperty is reported.Captionis reported by the analyzer but has no fixture: a profile'sCaptionis mandatory (AL0341) and the same property on a same-module target and extension collides (AL0570), so a single-module fixture cannot set it.Docs
.claude/rules/diagnostics/lc0091-translatable-text-should-be-translated.md: design decisions (property list per kind, page customization scope), deliberate non-reports, SDK facts (DefaultVisit, extension modifiability,PromotedActionCategoriessynthesis, same-module folding and AL0570/AL0341), test notes (compiler-generated IDs).Companion docs PR: ALCops/alcops.dev#241
Verification
dotnet build ALCops.sln: 0 errors (pre-existing MSB3277 test-project warnings only)dotnet test ALCops.sln: all passed (LinterCop 570, PlatformCop 784, ApplicationCop 634, FormattingCop 243, DocumentationCop 107, TestAutomationCop 30, Common 169)GITHUB_ACTIONS=true ... -p:NavTargetFramework=net8.0): 103 passed, 9 skipped (version-gated), 0 failed-c Release -p:ContinuousIntegrationBuild=true --no-incremental) for ApplicationCop, DocumentationCop, FormattingCop, LinterCop, PlatformCop, TestAutomationCop: 0 warnings, 0 errors eachdotnet format ALCops.sln --verify-no-changes: exit 0Validate-Rules.ps1: OK, 69 rules files pass all checks🤖 Generated with Claude Code