Skip to content

feat(LC0091): report object-level translatable properties - #685

Merged
Arthurvdv merged 3 commits into
mainfrom
feat/lc0091-object-level-properties
Nov 25, 2026
Merged

Arthurvdv merged 3 commits into
mainfrom
feat/lc0091-object-level-properties

Conversation

@Arthurvdv

@Arthurvdv Arthurvdv commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Closes #682
Part of #668

Summary

LC0091 reported only the object-level Caption and the page/report object ToolTip. The compiler writes a trans-unit for every property whose PropertyKindExtensions.IsTranslatableProperty() is true (Translation/LabelWriterVisitor.cs:51 DefaultVisit -> VisitSymbolWithProperties, loop at :229-240), so the other object-level translatable properties went unreported.

  • AnalyzePageLikeSymbol now loops over a static PropertyKind[] (Caption, ToolTip, InstructionalText, AdditionalSearchTerms, EntityCaption, EntitySetCaption, PromotedActionCategories, AboutTitle, AboutText) through a small ReportPageLikeObjectProperties helper; GetProperty returns null for kinds an object does not declare.
  • Fall-through: AdditionalSearchTerms for Report; ProfileDescription for Profile and ProfileExtension (newly registered; Caption is reported through the existing fall-through call).
  • PageCustomization is newly registered and checked for its object-level properties only (the compiler emits PageCustomization <hash> - Property <hash> units for PromotedActionCategories, AboutTitle, AboutText). Its controls/actions are not walked (modify blocks are group D).
  • EnumProvider.PropertyKind gains AdditionalSearchTerms, 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.cs property 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) synthesizes PromotedActionCategories only below ActionsV2 (10.0) when the property is absent; Emit/ExtensionObjectFoldingUtilities.GetTranslationRootSymbol folds same-module page/profile extensions into their target and leaves customizations as their own root.

Tests

Per item the empty-XLIFF HasDiagnostic, the Locked = true NoDiagnostic and the translated NoDiagnostic fixture (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, method NoDiagnosticTranslatedObjectProperties) and NamespaceTranslatedPageObjectAboutTitleXliffContent (method NoDiagnosticTranslatedObjectPropertiesWithNamespaces).

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"], runtime 16.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 plus Xliff Generator notes were copied from Translations/TestApp.g.xlf. The same compiles confirmed that every Locked variant 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 new HasDiagnostic cases plus NamespacePageObjectAboutTitle); the Locked/translated cases passed.

Deliberate non-reports found

  • Request page properties in a reportextension: InstructionalText, AboutTitle, AboutText inside a report extension's requestpage fail with AL0124, so there is nothing to report (the issue table listed them as extension-modifiable).
  • The Change Category_<name> - Property Caption units the compiler synthesizes from PromotedActionCategories on page extensions and page customizations (seen at runtime 16.0) and on pages below runtime 10.0: no declaration of their own; the PromotedActionCategories property is reported.
  • Profile extension Caption is reported by the analyzer but has no fixture: a profile's Caption is 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, PromotedActionCategories synthesis, 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)
  • LC0091 against the net8.0 analyzer binary (GITHUB_ACTIONS=true ... -p:NavTargetFramework=net8.0): 103 passed, 9 skipped (version-gated), 0 failed
  • Release three-TFM build (-c Release -p:ContinuousIntegrationBuild=true --no-incremental) for ApplicationCop, DocumentationCop, FormattingCop, LinterCop, PlatformCop, TestAutomationCop: 0 warnings, 0 errors each
  • 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 18:28
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]>
@Arthurvdv
Arthurvdv merged commit 038bff1 into main Nov 25, 2026
54 checks passed
@Arthurvdv
Arthurvdv deleted the feat/lc0091-object-level-properties branch November 25, 2026 19:28
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): object-level translatable properties

1 participant