Class LocalesProvider
Responsible for providing the list of locales that are currently available to this application.
Inheritance
System.Object
LocalesProvider
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.  |