Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ILocalizedTextService

    The entry point to localize any key in the text storage source for a given culture

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface ILocalizedTextService
    Remarks

    This class is created to be as simple as possible so that it can be replaced very easily, all other methods are extension methods that simply call the one underlying method in this class

    Methods

    View Source

    ConvertToSupportedCultureWithRegionCode(CultureInfo)

    Tries to resolve a full 4 letter culture from a 2 letter culture name

    Declaration
    CultureInfo ConvertToSupportedCultureWithRegionCode(CultureInfo currentCulture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo currentCulture

    The culture to determine if it is only a 2 letter culture, if so we'll try to convert it, otherwise it will just be returned

    Returns
    Type Description
    System.Globalization.CultureInfo
    Remarks

    TODO: This is just a hack due to the way we store the language files, they should be stored with 4 letters since that is what they reference but they are stored with 2, further more our user's languages are stored with 2. So this attempts to resolve the full culture if possible.

    View Source

    GetAllStoredValues(CultureInfo)

    Returns all key/values in storage for the given culture

    Declaration
    IDictionary<string, string> GetAllStoredValues(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture
    Returns
    Type Description
    IDictionary<System.String, System.String>
    View Source

    GetAllStoredValuesByAreaAndAlias(CultureInfo)

    Returns all key/values in storage for the given culture

    Declaration
    IDictionary<string, IDictionary<string, string>> GetAllStoredValuesByAreaAndAlias(CultureInfo culture)
    Parameters
    Type Name Description
    System.Globalization.CultureInfo culture
    Returns
    Type Description
    IDictionary<System.String, IDictionary<System.String, System.String>>
    View Source

    GetSupportedCultures()

    Returns a list of all currently supported cultures

    Declaration
    IEnumerable<CultureInfo> GetSupportedCultures()
    Returns
    Type Description
    IEnumerable<System.Globalization.CultureInfo>
    View Source

    Localize(String, String, CultureInfo, Nullable<IDictionary<String, String>>)

    Localize a key with variables

    Declaration
    string Localize(string area, string alias, CultureInfo culture, IDictionary<string, string>? tokens = null)
    Parameters
    Type Name Description
    System.String area
    System.String alias
    System.Globalization.CultureInfo culture
    System.Nullable<IDictionary<System.String, System.String>> tokens

    This can be null

    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • ConvertToSupportedCultureWithRegionCode(CultureInfo)
      • GetAllStoredValues(CultureInfo)
      • GetAllStoredValuesByAreaAndAlias(CultureInfo)
      • GetSupportedCultures()
      • Localize(String, String, CultureInfo, Nullable<IDictionary<String, String>>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX