Skip to content

Declare permission descriptions and deployment step labels with LocalizationSource.Create - #795

Merged
MikeAlhayek merged 1 commit into
mainfrom
claude/localization-source-alignment
Oct 7, 2026
Merged

MikeAlhayek merged 1 commit into
mainfrom
claude/localization-source-alignment

Conversation

@MikeAlhayek

Copy link
Copy Markdown
Member

Summary

Aligns our permissions and deployment steps with OrchardCMS/OrchardCore#19972, which introduced LocalizationSource and LocalizationSource.Create(...). The pinned OrchardCore build (4.0.0-preview-19174) already contains that change, so this PR changes how we declare labels and needs no package bump. It is independent of #793 and branches from main, so the two can merge in either order.

Permissions (101 declarations, 19 files)

  • Literal descriptions are now LocalizationSource.Create<T>("..."), with T the declaring class. When the declaring class is static, which can't be a type argument, they use LocalizationSource.Create("...", typeof(T)). This matches OrchardCore's own declarations, such as AdminPermissions and ContentVersionPruningPermissions.
  • The roles editor and permission pickers now translate these descriptions from PO files, using the declaring type as context. Before, they went through Data Localization as context-free strings.
  • Kept as plain strings: the four per-item templates (Query AI profile - {0}, Access AI tool - {0}, Import/Export {0} content items from file) and the string.Format(template.Description.Value, …) builders that expand them. OrchardCore does the same (e.g. AdminMenu's ViewAdminMenu_{0}).

Deployment steps (all 33)

  • Category and title are private static readonly LocalizationSource fields assigned in the constructor, matching OrchardCore's built-in steps. Before, each step allocated a new source for every instance.
  • Every step now sets a Title. Before, none did, so the step add/edit screens were headed by a name derived from the type (e.g. "AIProvider Connection"). Each title reuses the heading the step's thumbnail already shows (e.g. "AI Provider Connections", "Contact Center Queues"), so the wording stays the same.

Docs

  • 3.0.0 changelog entry under Localization.

Testing

  • dotnet build CrestApps.OrchardCore.slnx -c Release -warnaserror: 0 warnings, 0 errors.
  • CrestApps.OrchardCore.Tests: 7864 total, 0 failed, 1 skipped.
  • CrestApps.OrchardCore.ContactCenter.FeatureActivationTests: 90 total, 0 failed, 2 skipped.
  • Not yet checked in a running site: the roles editor and the deployment step screens.

🤖 Generated with Claude Code

…izationSource.Create

Align with OrchardCore#19972:

- Permission descriptions use LocalizationSource.Create<T>(...), or Create(..., typeof(T)) when the declaring
  type is static, so the roles editor translates them with the declaring type as PO context. Per-item templates
  ({0}) stay plain strings, as in Orchard Core.
- Deployment steps share their category and title sources through static readonly fields, and every step now
  sets a Title, so its add and edit screens are headed by name instead of by a name derived from its type.
@MikeAlhayek
MikeAlhayek merged commit ca93754 into main Oct 7, 2026
9 checks passed
@MikeAlhayek
MikeAlhayek deleted the claude/localization-source-alignment branch October 7, 2026 22: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.

1 participant