docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LocalizationSettings

    The localization settings is the core component to the localization system. It provides the entry point to all player based localization features.

    Inheritance
    object
    Object
    ScriptableObject
    LocalizationSettings
    Implements
    IReset
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.name
    Object.hideFlags
    Namespace: UnityEngine.Localization.Settings
    Assembly: Unity.Localization.dll
    Syntax
    public class LocalizationSettings : ScriptableObject, IReset

    Properties

    Name Description
    AssetDatabase

    The asset database is responsible for providing localized assets.

    AvailableLocales

    HasSettings

    Indicates if there is a LocalizationSettings present. If one is not found then it will attempt to find one however unlike Instance it will not create a default, if one can not be found.

    InitializationOperation

    The localization system may not be immediately ready. Loading Locales, preloading assets etc. This operation can be used to check when the system is ready. You can yield on this in a coroutine to wait. If InitializeSynchronously is true then this operation will complete synchronously the first time it is called. Uses WaitForCompletion to force the loading to complete synchronously. Please note that WaitForCompletion is not supported on WebGL and InitializeSynchronously will be ignored when running on WebGL.

    InitializeSynchronously

    Forces the InitializationOperation to complete immediately when it is started. Uses WaitForCompletion to force the loading to complete synchronously. Please note that WaitForCompletion is not supported on WebGL and InitializeSynchronously will be ignored when running on WebGL.

    Instance

    Singleton instance for the Localization Settings.

    Metadata

    Returns the Localization Settings Metadata. Metadata can be used to contain additional information such as App Name localization settings.

    PreloadBehavior

    Determines which tables, that have been marked as preload, will be loaded during the preloading step.

    ProjectLocale

    When tracking property variants in a scene, any changes you make whilst in this Locale are saved into the source object instead of as a variant.

    SelectedLocale

    The current selected Locale. This is the Locale that will be used by default when localizing assets and strings. Calling this when the Localization system has not initialized will force the Localization system to load all Locales before returning, see SelectedLocaleAsync for a version that will load the Locales asynchronously.

    SelectedLocaleAsync

    The current selected Locale. This is the Locale that will be used by default when localizing assets and strings. If InitializationOperation has not been completed yet then this will wait for the AvailableLocales part to complete first. It will not wait for the entire InitializationOperation but just the part that initializes the Locales. See SelectedLocale for a synchronous version that will block until the Locales have been loaded.

    StartupLocaleSelectors

    Determines what locale should be used for the SelectedLocale when the application starts or does not currently have an active SelectedLocale.

    StringDatabase

    The string database is responsible for providing localized string assets.

    Methods

    Name Description
    GetAssetDatabase()

    The asset database is responsible for providing localized assets.

    GetAvailableLocales()

    GetInitializationOperation()

    The localization system may not be immediately ready. Loading Locales, preloading assets etc. This operation can be used to check when the system is ready. You can yield on this in a coroutine to wait. If InitializeSynchronously is true then this operation will complete synchronously the first time it is called. Uses WaitForCompletion to force the loading to complete synchronously. Please note that WaitForCompletion is not supported on WebGL and InitializeSynchronously will be ignored when running on WebGL.

    GetInstanceDontCreateDefault()

    Returns the singleton of the LocalizationSettings but does not create a default one if no active settings are found.

    GetMetadata()

    Returns the Localization Settings Metadata. Metadata can be used to contain additional information such as App Name localization settings.

    GetSelectedLocale()

    The current selected Locale. This is the Locale that will be used by default when localizing assets and strings. Calling this when the Localization system has not initialized will force the Localization system to load all Locales before returning, see SelectedLocaleAsync for a version that will load the Locales asynchronously.

    GetSelectedLocaleAsync()

    The current selected Locale. This is the Locale that will be used by default when localizing assets and strings. If InitializationOperation has not been completed yet then this will wait for the AvailableLocales part to complete first. It will not wait for the entire InitializationOperation but just the part that initializes the Locales. See SelectedLocale for a synchronous version that will block until the Locales have been loaded.

    GetStartupLocaleSelectors()

    Determines what locale should be used for the SelectedLocale when the application starts or does not currently have an active SelectedLocale.

    GetStringDatabase()

    Returns the string database being used to localize all strings.

    OnLocaleRemoved(Locale)

    Indicates that the Locale is no longer available. If the locale is the current SelectedLocale then a new one will be found using StartupLocaleSelectors.

    ResetState()

    Resets the internal state of the object so it is ready to be used again and does not contain any data left over from a previous run.

    SelectLocaleUsingStartupSelectors()

    Uses StartupLocaleSelectors to select the most appropriate Locale.

    SetAssetDatabase(LocalizedAssetDatabase)

    The asset database is responsible for providing localized assets.

    SetAvailableLocales(ILocalesProvider)

    SetSelectedLocale(Locale)

    The current selected Locale. This is the Locale that will be used by default when localizing assets and strings. Calling this when the Localization system has not initialized will force the Localization system to load all Locales before returning, see SelectedLocaleAsync for a version that will load the Locales asynchronously.

    SetStringDatabase(LocalizedStringDatabase)

    Sets the string database to be used for localizing all strings.

    Events

    Name Description
    OnSelectedLocaleChanged

    Called when the SelectedLocale is changed. This will be called after InitializationOperation is completed so any preloading operations will be finished.

    SelectedLocaleChanged

    Event that is sent when the SelectedLocale is changed.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)