Class LocalesProvider | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalesProvider

    Responsible for providing the list of locales that are currently available to this application.

    Inheritance
    System.Object
    LocalesProvider
    AddressableLocalesProvider
    LocalizationSettingsTests.SimpleLocalesProvider
    Namespace: UnityEngine.Localization
    Syntax
    public abstract class LocalesProvider : ScriptableObject

    Properties

    Locales

    The list of all supported locales.

    Declaration
    public abstract List<Locale> Locales { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Locale>

    Methods

    AddLocale(Locale)

    Add a Locale to allow support for a specific language.

    Declaration
    public virtual void AddLocale(Locale locale)
    Parameters
    Type Name Description
    Locale locale

    GetLocale(String)

    Attempt to retrieve a Locale using a Code.

    Declaration
    public virtual Locale GetLocale(string code)
    Parameters
    Type Name Description
    System.String code

    If no Locale can be found then null is returned.

    Returns
    Type Description
    Locale

    GetLocale(SystemLanguage)

    Attempt to retrieve a Locale using a .

    Declaration
    public Locale GetLocale(SystemLanguage systemLanguage)
    Parameters
    Type Name Description
    SystemLanguage systemLanguage
    Returns
    Type Description
    Locale

    If no Locale can be found then null is returned.

    GetLocale(LocaleIdentifier)

    Attempt to retrieve a Locale using the identifier.

    Declaration
    public virtual Locale GetLocale(LocaleIdentifier id)
    Parameters
    Type Name Description
    LocaleIdentifier id

    LocaleIdentifier to find.

    Returns
    Type Description
    Locale

    If no Locale can be found then null is returned.

    RemoveLocale(Locale)

    Removes support for a specific Locale.

    Declaration
    public virtual bool RemoveLocale(Locale locale)
    Parameters
    Type Name Description
    Locale locale

    The locale that should be removed if possible.

    Returns
    Type Description
    System.Boolean

    true if the locale was removed or false if the locale did not exist.

    In This Article
    • Properties
      • Locales
    • Methods
      • AddLocale(Locale)
      • GetLocale(String)
      • GetLocale(SystemLanguage)
      • GetLocale(LocaleIdentifier)
      • RemoveLocale(Locale)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023