# GetLocale(LocaleIdentifier)

> Returns the available locale with the given identifier, or null.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Localization](/engine/6000.7/script-reference/unity/localization.md)
* **Assembly:** UnityEngine.LocalizationRuntimeModule

```csharp
public Locale GetLocale(LocaleIdentifier identifier)
```

### Parameters

**** (\[LocaleIdentifier]\(/engine/6000.7/script-reference/unity/localization/localeidentifier)): The identifier of the locale to find.

### Returns

| Type                                                                   | Description                                                                   |
| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Locale](/engine/6000.7/script-reference/unity/localization/locale.md) | The registered locale that matches the identifier, or null when none matches. |

### Remarks

Searches [LocalizationSettings.AvailableLocales](/engine/6000.7/script-reference/unity/localization/localizationsettings/availablelocales.md) for a locale whose [LocaleIdentifier](/engine/6000.7/script-reference/unity/localization/localeidentifier.md) matches, including disabled locales. The match is case-insensitive on the locale code. Use this to turn a code into a [Locale](/engine/6000.7/script-reference/unity/localization/locale.md) before assigning it to [LocalizationSettings.SelectedLocale](/engine/6000.7/script-reference/unity/localization/localizationsettings/selectedlocale.md).

Finds a locale by code and selects it.

### Examples

```csharp
using Unity.Localization;

namespace Unity.Localization.Samples
{
    public class GetLocaleExample
    {
        public void Run()
        {
            Locale french = LocalizationSettings.Instance.GetLocale(new LocaleIdentifier("fr"));
            if (french != null)
                LocalizationSettings.SelectedLocale = french;
        }
    }
}
```
