Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetSystemCulture()

Returns the culture used to detect the startup locale.
Read time 1 minuteLast updated a day ago

Definition

  • Type: Method
  • Namespace: Unity.Localization
  • Assembly: UnityEngine.LocalizationRuntimeModule
protected virtual CultureInfo GetSystemCulture()

Returns

Type

Description

CultureInfoThe culture used to detect the locale; by default the language the device is set to.

Remarks

By default this returns the language the user asked the operating system for, which Apple platforms, Android and WebGL report as a language tag carrying the region and the script. On platforms that cannot report one it returns CurrentUICulture instead. Override it in a derived selector to supply a fixed culture, which replaces both and is useful for testing locale detection without changing the device settings.
Overrides the detected culture to always report German.

Examples

using System.Globalization;using Unity.Localization;namespace Unity.Localization.Samples{ public class SystemCultureOverrideExample : SystemLocaleSelector { protected override CultureInfo GetSystemCulture() => new CultureInfo("de"); }}