docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GetLocale

    GetLocale(LocaleIdentifier)

    Returns the locale that matches the LocaleIdentifier"/> in the project.

    Declaration
    public static Locale GetLocale(LocaleIdentifier localeId)
    Parameters
    Type Name Description
    LocaleIdentifier localeId
    Returns
    Type Description
    Locale

    The found Locale or null if one could not be found.

    Examples

    This example shows how to find a Locale using a SystemLanguage or code.

    // Find a Spanish Locale using the SystemLanguage
    var spanish = LocalizationEditorSettings.GetLocale(SystemLanguage.Spanish);
    
    // Find a Spanish (Mexico) Locale using the code
    var spanishMexico = LocalizationEditorSettings.GetLocale("es-MX");
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)