Repository navigation
Declare permission descriptions and deployment step labels with LocalizationSource.Create - #795
Merged
Merged
Conversation
…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.
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.
Summary
Aligns our permissions and deployment steps with OrchardCMS/OrchardCore#19972, which introduced
LocalizationSourceandLocalizationSource.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 frommain, so the two can merge in either order.Permissions (101 declarations, 19 files)
LocalizationSource.Create<T>("..."), withTthe declaring class. When the declaring class is static, which can't be a type argument, they useLocalizationSource.Create("...", typeof(T)). This matches OrchardCore's own declarations, such asAdminPermissionsandContentVersionPruningPermissions.Query AI profile - {0},Access AI tool - {0},Import/Export {0} content items from file) and thestring.Format(template.Description.Value, …)builders that expand them. OrchardCore does the same (e.g.AdminMenu'sViewAdminMenu_{0}).Deployment steps (all 33)
private static readonly LocalizationSourcefields assigned in the constructor, matching OrchardCore's built-in steps. Before, each step allocated a new source for every instance.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
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.🤖 Generated with Claude Code