Class LocalizationEditorSettings | Localization | 0.7.1-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalizationEditorSettings

    Editor interface for modifying Localization settings and Localization based Addressables properties.

    Inheritance
    Object
    LocalizationEditorSettings
    Namespace: UnityEditor.Localization
    Syntax
    public class LocalizationEditorSettings

    Properties

    ActiveLocalizationSettings

    The LocalizationSettings used for this project.

    Declaration
    public static LocalizationSettings ActiveLocalizationSettings { get; set; }
    Property Value
    Type Description
    LocalizationSettings
    Remarks

    The activeLocalizationSettings will be available in any player builds and the editor when playing. During a build or entering play mode, the asset will be added to the preloaded assets list. Note: This needs to be an asset.

    ActiveLocalizationSettingsInternal

    Declaration
    protected virtual LocalizationSettings ActiveLocalizationSettingsInternal { get; set; }
    Property Value
    Type Description
    LocalizationSettings

    EditorEvents

    Localization modification events.

    Declaration
    public static LocalizationEditorEvents EditorEvents { get; }
    Property Value
    Type Description
    LocalizationEditorEvents

    ShowLocaleMenuInGameView

    During play mode, in the editor a menu can be shown to allow for quickly changing the SelectedLocale.

    Declaration
    public static bool ShowLocaleMenuInGameView { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    AddLocale(Locale, Boolean)

    Add the Locale to the Addressables system, so that it can be used by the Localization system during runtime.

    Declaration
    public static void AddLocale(Locale locale, bool createUndo = false)
    Parameters
    Type Name Description
    Locale locale

    The Locale to add to Addressables so that it can be used by the Localization system.

    Boolean createUndo

    Used to indicate if an Undo operation should be created.

    AddLocaleInternal(Locale, Boolean)

    Declaration
    protected virtual void AddLocaleInternal(Locale locale, bool createUndo)
    Parameters
    Type Name Description
    Locale locale
    Boolean createUndo

    CreateAssetTableCollection(String, String)

    Creates a AssetTableCollection using the project Locales.

    Declaration
    public static AssetTableCollection CreateAssetTableCollection(string tableName, string assetDirectory)
    Parameters
    Type Name Description
    String tableName

    The name of the new collection.

    String assetDirectory

    The directory to save the generated assets, must be in the project Assets directory.

    Returns
    Type Description
    AssetTableCollection

    CreateAssetTableCollection(String, String, IList<Locale>)

    Creates a AssetTableCollection using the provided Locales.

    Declaration
    public static AssetTableCollection CreateAssetTableCollection(string tableName, string assetDirectory, IList<Locale> selectedLocales)
    Parameters
    Type Name Description
    String tableName
    String assetDirectory
    IList<Locale> selectedLocales

    The locales to generate the collection with. A AssetTable will be created for each Locale

    Returns
    Type Description
    AssetTableCollection

    CreateCollection(Type, String, String, IList<Locale>)

    Declaration
    protected virtual LocalizedTableCollection CreateCollection(Type collectionType, string tableName, string assetDirectory, IList<Locale> selectedLocales)
    Parameters
    Type Name Description
    Type collectionType
    String tableName
    String assetDirectory
    IList<Locale> selectedLocales
    Returns
    Type Description
    LocalizedTableCollection

    CreateCollectionFromLooseTables(IList<LocalizedTable>, String)

    Creates a StringTableCollection or AssetTableCollection from the loose tables.

    Declaration
    public static LocalizedTableCollection CreateCollectionFromLooseTables(IList<LocalizedTable> looseTables, string path)
    Parameters
    Type Name Description
    IList<LocalizedTable> looseTables

    Tables to create the collection from. All tables must be of the same type.

    String path
    Returns
    Type Description
    LocalizedTableCollection

    CreateCollectionFromLooseTablesInternal(IList<LocalizedTable>, String)

    Creates a new StringTableCollection or AssetTableCollection from the provided list of tables that do not currently belong to a collection.

    Declaration
    protected virtual LocalizedTableCollection CreateCollectionFromLooseTablesInternal(IList<LocalizedTable> looseTables, string path)
    Parameters
    Type Name Description
    IList<LocalizedTable> looseTables
    String path
    Returns
    Type Description
    LocalizedTableCollection

    CreateStringTableCollection(String, String)

    Creates a StringTableCollection using the project Locales.

    Declaration
    public static StringTableCollection CreateStringTableCollection(string tableName, string assetDirectory)
    Parameters
    Type Name Description
    String tableName

    The name of the new collection.

    String assetDirectory

    The directory to save the generated assets, must be in the project Assets directory.

    Returns
    Type Description
    StringTableCollection

    CreateStringTableCollection(String, String, IList<Locale>)

    Creates a StringTableCollection using the provided Locales.

    Declaration
    public static StringTableCollection CreateStringTableCollection(string tableName, string assetDirectory, IList<Locale> selectedLocales)
    Parameters
    Type Name Description
    String tableName

    The name of the new collection.

    String assetDirectory

    The directory to save the generated assets, must be in the project Assets directory.

    IList<Locale> selectedLocales

    The locales to generate the collection with. A StringTable will be created for each Locale.

    Returns
    Type Description
    StringTableCollection

    FindLooseStringTablesUsingSharedTableData(SharedTableData, IList<LocalizedTable>)

    If a table does not belong to a LocalizedTableCollection then it is considered to be loose, it has no parent collection and will be ignored. This returns all loose tables that use the same SharedTableData, they can then be converted into a LocalizedTableCollection.

    Declaration
    public static void FindLooseStringTablesUsingSharedTableData(SharedTableData sharedTableData, IList<LocalizedTable> foundTables)
    Parameters
    Type Name Description
    SharedTableData sharedTableData
    IList<LocalizedTable> foundTables

    FindSimilarKey(String)

    Returns the AssetTableCollection that contains a table entry with the closest match to the provided text. Uses the Levenshtein distance method.

    Declaration
    public static (StringTableCollection collection, SharedTableData.SharedTableEntry entry, int matchDistance) FindSimilarKey(string keyName)
    Parameters
    Type Name Description
    String keyName
    Returns
    Type Description
    ValueTuple<StringTableCollection, SharedTableData.SharedTableEntry, Int32>

    FindSimilarKeyInternal(String)

    Declaration
    protected virtual (StringTableCollection collection, SharedTableData.SharedTableEntry entry, int matchDistance) FindSimilarKeyInternal(string keyName)
    Parameters
    Type Name Description
    String keyName
    Returns
    Type Description
    ValueTuple<StringTableCollection, SharedTableData.SharedTableEntry, Int32>

    FindUniqueAssetAddress(String)

    Tries to find a unique address for the asset to be stored in Addressables.

    Declaration
    protected virtual string FindUniqueAssetAddress(string address)
    Parameters
    Type Name Description
    String address
    Returns
    Type Description
    String

    GetAssetTableCollection(TableReference)

    Returns a AssetTableCollection with the matching TableReference.

    Declaration
    public static AssetTableCollection GetAssetTableCollection(TableReference tableNameOrGuid)
    Parameters
    Type Name Description
    TableReference tableNameOrGuid
    Returns
    Type Description
    AssetTableCollection

    GetAssetTableCollections()

    Returns all AssetTableCollection assets in the project.

    Declaration
    public static ReadOnlyCollection<AssetTableCollection> GetAssetTableCollections()
    Returns
    Type Description
    ReadOnlyCollection<AssetTableCollection>

    GetCollectionForSharedTableData(SharedTableData)

    Returns the LocalizedTableCollection that the SharedTableData is part of or null if one could not be found.

    Declaration
    public static LocalizedTableCollection GetCollectionForSharedTableData(SharedTableData sharedTableData)
    Parameters
    Type Name Description
    SharedTableData sharedTableData
    Returns
    Type Description
    LocalizedTableCollection

    GetCollectionFromTable(LocalizedTable)

    Returns the LocalizedTableCollection that the table is part of or null if the table has no collection.

    Declaration
    public static LocalizedTableCollection GetCollectionFromTable(LocalizedTable table)
    Parameters
    Type Name Description
    LocalizedTable table
    Returns
    Type Description
    LocalizedTableCollection

    GetGroup(AddressableAssetSettings, String, Boolean, Boolean)

    Returns the Addressables group with the matching name or creates a new one, if one could not be found.

    Declaration
    protected virtual AddressableAssetGroup GetGroup(AddressableAssetSettings settings, string groupName, bool create, bool createUndo)
    Parameters
    Type Name Description
    AddressableAssetSettings settings
    String groupName
    Boolean create
    Boolean createUndo

    Used to indicate if an Undo operation should be created.

    Returns
    Type Description
    AddressableAssetGroup

    GetLocale(String)

    Returns the locale for the code if it exists in the project.

    Declaration
    public static Locale GetLocale(string code)
    Parameters
    Type Name Description
    String code
    Returns
    Type Description
    Locale

    GetLocaleInternal(String)

    Declaration
    protected virtual Locale GetLocaleInternal(string code)
    Parameters
    Type Name Description
    String code
    Returns
    Type Description
    Locale

    GetLocales()

    Returns all locales that are part of the Addressables system.

    Declaration
    public static ReadOnlyCollection<Locale> GetLocales()
    Returns
    Type Description
    ReadOnlyCollection<Locale>

    GetLocalesInternal()

    Declaration
    protected virtual ReadOnlyCollection<Locale> GetLocalesInternal()
    Returns
    Type Description
    ReadOnlyCollection<Locale>

    GetPreloadTableFlag(LocalizedTable)

    Returns true if the table is marked for preloading.

    Declaration
    public static bool GetPreloadTableFlag(LocalizedTable table)
    Parameters
    Type Name Description
    LocalizedTable table
    Returns
    Type Description
    Boolean

    GetPreloadTableFlagInternal(LocalizedTable)

    Declaration
    protected virtual bool GetPreloadTableFlagInternal(LocalizedTable table)
    Parameters
    Type Name Description
    LocalizedTable table
    Returns
    Type Description
    Boolean
    Exceptions
    Type Condition
    ArgumentNullException
    AddressableEntryNotFoundException

    GetStringTableCollection(TableReference)

    Returns a StringTableCollection with the matching TableReference.

    Declaration
    public static StringTableCollection GetStringTableCollection(TableReference tableNameOrGuid)
    Parameters
    Type Name Description
    TableReference tableNameOrGuid
    Returns
    Type Description
    StringTableCollection

    Found collection or null if one could not be found.

    GetStringTableCollections()

    Returns all StringTableCollection assets in the project.

    Declaration
    public static ReadOnlyCollection<StringTableCollection> GetStringTableCollections()
    Returns
    Type Description
    ReadOnlyCollection<StringTableCollection>

    RemoveLocale(Locale, Boolean)

    Removes the locale from the Addressables system.

    Declaration
    public static void RemoveLocale(Locale locale, bool createUndo = false)
    Parameters
    Type Name Description
    Locale locale

    The Locale to remove from Addressables so that it is no longer used by the Localization system.

    Boolean createUndo

    Used to indicate if an Undo operation should be created.

    RemoveLocaleInternal(Locale, Boolean)

    Declaration
    protected virtual void RemoveLocaleInternal(Locale locale, bool createUndo)
    Parameters
    Type Name Description
    Locale locale
    Boolean createUndo

    SetPreloadTableFlag(LocalizedTable, Boolean, Boolean)

    Adds/Removes the preload flag for the table.

    Declaration
    public static void SetPreloadTableFlag(LocalizedTable table, bool preload, bool createUndo = false)
    Parameters
    Type Name Description
    LocalizedTable table
    Boolean preload
    Boolean createUndo

    SetPreloadTableInternal(LocalizedTable, Boolean, Boolean)

    Declaration
    protected virtual void SetPreloadTableInternal(LocalizedTable table, bool preload, bool createUndo = false)
    Parameters
    Type Name Description
    LocalizedTable table
    Boolean preload
    Boolean createUndo
    Exceptions
    Type Condition
    ArgumentNullException
    AddressableEntryNotFoundException
    In This Article
    • Properties
      • ActiveLocalizationSettings
      • ActiveLocalizationSettingsInternal
      • EditorEvents
      • ShowLocaleMenuInGameView
    • Methods
      • AddLocale(Locale, Boolean)
      • AddLocaleInternal(Locale, Boolean)
      • CreateAssetTableCollection(String, String)
      • CreateAssetTableCollection(String, String, IList<Locale>)
      • CreateCollection(Type, String, String, IList<Locale>)
      • CreateCollectionFromLooseTables(IList<LocalizedTable>, String)
      • CreateCollectionFromLooseTablesInternal(IList<LocalizedTable>, String)
      • CreateStringTableCollection(String, String)
      • CreateStringTableCollection(String, String, IList<Locale>)
      • FindLooseStringTablesUsingSharedTableData(SharedTableData, IList<LocalizedTable>)
      • FindSimilarKey(String)
      • FindSimilarKeyInternal(String)
      • FindUniqueAssetAddress(String)
      • GetAssetTableCollection(TableReference)
      • GetAssetTableCollections()
      • GetCollectionForSharedTableData(SharedTableData)
      • GetCollectionFromTable(LocalizedTable)
      • GetGroup(AddressableAssetSettings, String, Boolean, Boolean)
      • GetLocale(String)
      • GetLocaleInternal(String)
      • GetLocales()
      • GetLocalesInternal()
      • GetPreloadTableFlag(LocalizedTable)
      • GetPreloadTableFlagInternal(LocalizedTable)
      • GetStringTableCollection(TableReference)
      • GetStringTableCollections()
      • RemoveLocale(Locale, Boolean)
      • RemoveLocaleInternal(Locale, Boolean)
      • SetPreloadTableFlag(LocalizedTable, Boolean, Boolean)
      • SetPreloadTableInternal(LocalizedTable, Boolean, Boolean)
    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