Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ILocalizationService

    Defines the Localization Service, which is an easy access to operations involving Languages and Dictionary

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface ILocalizationService : IService

    Methods

    View Source

    AddOrUpdateDictionaryValue(IDictionaryItem, ILanguage, String)

    Adds or updates a translation for a dictionary item and language

    Declaration
    void AddOrUpdateDictionaryValue(IDictionaryItem item, ILanguage language, string value)
    Parameters
    Type Name Description
    IDictionaryItem item
    ILanguage language
    System.String value
    View Source

    CreateDictionaryItemWithIdentity(String, Nullable<Guid>, String)

    Creates and saves a new dictionary item and assigns a value to all languages if defaultValue is specified.

    Declaration
    IDictionaryItem CreateDictionaryItemWithIdentity(string key, Guid? parentId, string defaultValue = null)
    Parameters
    Type Name Description
    System.String key
    System.Nullable<Guid> parentId
    System.String defaultValue
    Returns
    Type Description
    IDictionaryItem
    View Source

    Delete(IDictionaryItem, Int32)

    Deletes a IDictionaryItem object and its related translations as well as its children.

    Declaration
    void Delete(IDictionaryItem dictionaryItem, int userId = -1)
    Parameters
    Type Name Description
    IDictionaryItem dictionaryItem

    IDictionaryItem to delete

    System.Int32 userId

    Optional id of the user deleting the dictionary item

    View Source

    Delete(ILanguage, Int32)

    Deletes a ILanguage by removing it and its usages from the db

    Declaration
    void Delete(ILanguage language, int userId = -1)
    Parameters
    Type Name Description
    ILanguage language

    ILanguage to delete

    System.Int32 userId

    Optional id of the user deleting the language

    View Source

    DictionaryItemExists(String)

    Checks if a IDictionaryItem with given key exists

    Declaration
    bool DictionaryItemExists(string key)
    Parameters
    Type Name Description
    System.String key

    Key of the IDictionaryItem

    Returns
    Type Description
    System.Boolean

    True if a IDictionaryItem exists, otherwise false

    View Source

    GetAllLanguages()

    Gets all available languages

    Declaration
    IEnumerable<ILanguage> GetAllLanguages()
    Returns
    Type Description
    IEnumerable<ILanguage>

    An enumerable list of ILanguage objects

    View Source

    GetAllLanguagesPaged(Int32, Int32)

    Declaration
    virtual PagedModel<ILanguage> GetAllLanguagesPaged(int skip, int take)
    Parameters
    Type Name Description
    System.Int32 skip
    System.Int32 take
    Returns
    Type Description
    Umbraco.New.Cms.Core.Models.PagedModel<ILanguage>
    View Source

    GetDefaultLanguageId()

    Gets the default language identifier.

    Declaration
    int? GetDefaultLanguageId()
    Returns
    Type Description
    System.Nullable<System.Int32>
    Remarks

    This can be optimized and bypass all deep cloning.

    View Source

    GetDefaultLanguageIsoCode()

    Gets the default language ISO code.

    Declaration
    string GetDefaultLanguageIsoCode()
    Returns
    Type Description
    System.String
    Remarks

    This can be optimized and bypass all deep cloning.

    View Source

    GetDictionaryItemById(Guid)

    Gets a IDictionaryItem by its id

    Declaration
    IDictionaryItem GetDictionaryItemById(Guid id)
    Parameters
    Type Name Description
    Guid id

    Id of the IDictionaryItem

    Returns
    Type Description
    IDictionaryItem IDictionaryItem
    View Source

    GetDictionaryItemById(Int32)

    Gets a IDictionaryItem by its System.Int32 id

    Declaration
    IDictionaryItem GetDictionaryItemById(int id)
    Parameters
    Type Name Description
    System.Int32 id

    Id of the IDictionaryItem

    Returns
    Type Description
    IDictionaryItem IDictionaryItem
    View Source

    GetDictionaryItemByKey(String)

    Gets a IDictionaryItem by its key

    Declaration
    IDictionaryItem GetDictionaryItemByKey(string key)
    Parameters
    Type Name Description
    System.String key

    Key of the IDictionaryItem

    Returns
    Type Description
    IDictionaryItem IDictionaryItem
    View Source

    GetDictionaryItemChildren(Guid)

    Gets a list of children for a IDictionaryItem

    Declaration
    IEnumerable<IDictionaryItem> GetDictionaryItemChildren(Guid parentId)
    Parameters
    Type Name Description
    Guid parentId

    Id of the parent

    Returns
    Type Description
    IEnumerable<IDictionaryItem>

    An enumerable list of IDictionaryItem objects

    View Source

    GetDictionaryItemDescendants(Nullable<Guid>)

    Gets a list of descendants for a IDictionaryItem

    Declaration
    IEnumerable<IDictionaryItem> GetDictionaryItemDescendants(Guid? parentId)
    Parameters
    Type Name Description
    System.Nullable<Guid> parentId

    Id of the parent, null will return all dictionary items

    Returns
    Type Description
    IEnumerable<IDictionaryItem>

    An enumerable list of IDictionaryItem objects

    View Source

    GetDictionaryItemKeyMap()

    Gets the full dictionary key map.

    Declaration
    Dictionary<string, Guid> GetDictionaryItemKeyMap()
    Returns
    Type Description
    Umbraco.Cms.Core.Dictionary<System.String, Guid>

    The full dictionary key map.

    View Source

    GetDictionaryItemsByIds(Guid[])

    Gets a collection of IDictionaryItem by their ids

    Declaration
    virtual IEnumerable<IDictionaryItem> GetDictionaryItemsByIds(params Guid[] ids)
    Parameters
    Type Name Description
    Guid[] ids

    Ids of the IDictionaryItem

    Returns
    Type Description
    IEnumerable<IDictionaryItem>

    A collection of IDictionaryItem

    View Source

    GetDictionaryItemsByKeys(String[])

    Gets a collection of IDictionaryItem by their keys

    Declaration
    virtual IEnumerable<IDictionaryItem> GetDictionaryItemsByKeys(params string[] keys)
    Parameters
    Type Name Description
    System.String[] keys

    Keys of the IDictionaryItem

    Returns
    Type Description
    IEnumerable<IDictionaryItem>

    A collection of IDictionaryItem

    View Source

    GetLanguageById(Int32)

    Gets a ILanguage by its id

    Declaration
    ILanguage GetLanguageById(int id)
    Parameters
    Type Name Description
    System.Int32 id

    Id of the ILanguage

    Returns
    Type Description
    ILanguage ILanguage
    View Source

    GetLanguageByIsoCode(String)

    Gets a ILanguage by its iso code

    Declaration
    ILanguage GetLanguageByIsoCode(string isoCode)
    Parameters
    Type Name Description
    System.String isoCode

    Iso Code of the language (ie. en-US)

    Returns
    Type Description
    ILanguage ILanguage
    View Source

    GetLanguageIdByIsoCode(String)

    Gets a language identifier from its ISO code.

    Declaration
    int? GetLanguageIdByIsoCode(string isoCode)
    Parameters
    Type Name Description
    System.String isoCode
    Returns
    Type Description
    System.Nullable<System.Int32>
    Remarks

    This can be optimized and bypass all deep cloning.

    View Source

    GetLanguageIsoCodeById(Int32)

    Gets a language ISO code from its identifier.

    Declaration
    string GetLanguageIsoCodeById(int id)
    Parameters
    Type Name Description
    System.Int32 id
    Returns
    Type Description
    System.String
    Remarks

    This can be optimized and bypass all deep cloning.

    View Source

    GetRootDictionaryItems()

    Gets the root/top IDictionaryItem objects

    Declaration
    IEnumerable<IDictionaryItem> GetRootDictionaryItems()
    Returns
    Type Description
    IEnumerable<IDictionaryItem>

    An enumerable list of IDictionaryItem objects

    View Source

    Save(IDictionaryItem, Int32)

    Saves a IDictionaryItem object

    Declaration
    void Save(IDictionaryItem dictionaryItem, int userId = -1)
    Parameters
    Type Name Description
    IDictionaryItem dictionaryItem

    IDictionaryItem to save

    System.Int32 userId

    Optional id of the user saving the dictionary item

    View Source

    Save(ILanguage, Int32)

    Saves a ILanguage object

    Declaration
    void Save(ILanguage language, int userId = -1)
    Parameters
    Type Name Description
    ILanguage language

    ILanguage to save

    System.Int32 userId

    Optional id of the user saving the language

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • AddOrUpdateDictionaryValue(IDictionaryItem, ILanguage, String)
      • CreateDictionaryItemWithIdentity(String, Nullable<Guid>, String)
      • Delete(IDictionaryItem, Int32)
      • Delete(ILanguage, Int32)
      • DictionaryItemExists(String)
      • GetAllLanguages()
      • GetAllLanguagesPaged(Int32, Int32)
      • GetDefaultLanguageId()
      • GetDefaultLanguageIsoCode()
      • GetDictionaryItemById(Guid)
      • GetDictionaryItemById(Int32)
      • GetDictionaryItemByKey(String)
      • GetDictionaryItemChildren(Guid)
      • GetDictionaryItemDescendants(Nullable<Guid>)
      • GetDictionaryItemKeyMap()
      • GetDictionaryItemsByIds(Guid[])
      • GetDictionaryItemsByKeys(String[])
      • GetLanguageById(Int32)
      • GetLanguageByIsoCode(String)
      • GetLanguageIdByIsoCode(String)
      • GetLanguageIsoCodeById(Int32)
      • GetRootDictionaryItems()
      • Save(IDictionaryItem, Int32)
      • Save(ILanguage, Int32)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX