Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AddLocale(Locale)

Registers a locale as available, deduplicated by locale code.
Read time 1 minuteLast updated 13 days ago

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
public void AddLocale(Locale locale)

Parameters

locale

The locale to register as available.

Remarks

Adds the locale to LocalizationSettings.AvailableLocales unless a locale with the same LocaleIdentifier is already registered, in which case the call is ignored. A null locale is ignored. Use LocalizationSettings.RemoveLocale to remove a locale.
Registers a French locale.

Examples

using Unity.Localization;namespace Unity.Localization.Samples{ public class AddLocaleExample { public void Run() { LocalizationSettings.Instance.AddLocale(new Locale("fr", "French")); } }}