Skip to content

Centrlize the Data Localization Contexts #19034

@hishamco

Description

@hishamco

Is your feature request related to a problem?

The problem is that there are many places where we use the context as a magic string, which might cause a problematic

Describe the solution you'd like

The idea is to create a DataLocalizationConstants which contains constants and helpers to simplify creating the context for the supported localization providers

public sealed class DataLocalizationConstants
{
    public const string ContentTypesContext = "ContentTypes";

    public static string ContentFields(string fieldName)
        => $"Content Fields{Constants.ContextSeparator}{fieldName}";

    public static string Permission(string groupName = null)
        => groupName is null
            ? "Permissions"
            : $"Permissions{Constants.ContextSeparator}{groupName}";
}

Describe alternatives you've considered

Nothing

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions