Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

SpecificLocaleSelector

class in Unity.Localization


Implements interfaces:IStartupLocaleSelector

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Selects a fixed locale by its identifier when that locale is available.

Use this selector to force a specific locale at startup regardless of the device or command line. Set SpecificLocaleSelector.LocaleId to the LocaleIdentifier of the locale to select. If no available locale matches the identifier, SpecificLocaleSelector.GetStartupLocale returns null and the next selector in LocalizationSettings.StartupSelectors runs.

Additional resources: IStartupLocaleSelector, LocalizationSettings, Locale

<para>Selects French when it is one of the available locales.</para>

using Unity.Localization;

namespace Unity.Localization.Samples { public class SpecificLocaleSelectorExample { public Locale Run() { var selector = new SpecificLocaleSelector { LocaleId = new LocaleIdentifier("fr") }; Locale french = selector.GetStartupLocale(LocalizationSettings.Instance); return french; } } }

Properties

Property Description
LocaleId The identifier of the locale to select.