Method AddLocale
AddLocale(Locale, bool)
Add the Locale so that it can be used by the Localization system.
Declaration
public static void AddLocale(Locale locale, bool createUndo = false)
Parameters
Type | Name | Description |
---|---|---|
Locale | locale | The Locale to add to the project so it can be used by the Localization system. |
bool | createUndo | Used to indicate if an Undo operation should be created. |
Examples
This shows how to create a Locale and add it to the project.
// Create the Locale asset
var locale = Locale.CreateLocale(SystemLanguage.Spanish);
AssetDatabase.CreateAsset(locale, "Assets/Spanish.asset");
// Add the Locale to the project
LocalizationEditorSettings.AddLocale(locale);