Skip to content

Centrlize the Data Localization Contexts #19034

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions