# Locale

> Represents a selectable language or region in a localized project. A locale carries a culture code, an optional display name, a formatting culture, and an optional fallback.

## Definition

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

```csharp
public class Locale
```

## Remarks

A locale is the unit the runtime selects between when it resolves localized content. It pairs a [LocaleIdentifier](/engine/6000.7/script-reference/unity/localization/localeidentifier.md) (the culture code) with a display name and the formatting culture reported by [Locale.CultureInfo](/engine/6000.7/script-reference/unity/localization/locale/cultureinfo.md), which drives number, date, and string formatting. When a value is missing in the selected locale, the runtime can fall back to the locale named by [Locale.FallbackCode](/engine/6000.7/script-reference/unity/localization/locale/fallbackcode.md). A locale is a plain serializable object rather than a `ScriptableObject` asset, so it is stored inline in the localization settings.

Additional Resources: [LocaleIdentifier](/engine/6000.7/script-reference/unity/localization/localeidentifier.md), [ResourceTable](/engine/6000.7/script-reference/unity/localization/resourcetable.md), [SharedTableData](/engine/6000.7/script-reference/unity/localization/sharedtabledata.md)

Create a locale, then read its identifier, display name, and formatting culture.

## Examples

```csharp
using Unity.Localization;
using UnityEngine;

namespace Unity.Localization.Samples
{
    public class LocaleOverviewExample
    {
        public void Run()
        {
            var locale = new Locale("fr-CA", "French (Canada)");

            Debug.Log(locale.Identifier);        // fr-CA
            Debug.Log(locale.LocaleName);        // French (Canada)
            Debug.Log(locale.CultureInfo.Name);  // fr-CA
            Debug.Log(locale.Enabled);           // True
        }
    }
}
```

## Constructors

| Constructor                                                                                                                      | Description                                                         |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [Locale()](/engine/6000.7/script-reference/unity/localization/locale/ctor.md#locale\(\))                                         | Creates a locale with no culture code.                              |
| [Locale(System.String,System.String)](/engine/6000.7/script-reference/unity/localization/locale/ctor.md#locale\(string-string\)) | Creates a locale for a culture code, with an optional display name. |

## Properties

| Property                                                                                  | Description                                                                                                                   |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [Code](/engine/6000.7/script-reference/unity/localization/locale/code.md)                 | The culture code, for example "en" or "fr-CA".                                                                                |
| [CultureInfo](/engine/6000.7/script-reference/unity/localization/locale/cultureinfo.md)   | The formatting culture for this locale, or the invariant culture when the code is not a known culture.                        |
| [Enabled](/engine/6000.7/script-reference/unity/localization/locale/enabled.md)           | Whether the locale is active: a disabled locale is excluded from runtime selection and its tables are not shipped in a build. |
| [FallbackCode](/engine/6000.7/script-reference/unity/localization/locale/fallbackcode.md) | The culture code of the fallback locale, resolved through the settings, or null when there is no fallback.                    |
| [Identifier](/engine/6000.7/script-reference/unity/localization/locale/identifier.md)     | The identifier for this locale.                                                                                               |
| [LocaleName](/engine/6000.7/script-reference/unity/localization/locale/localename.md)     | The display name, for example "English". When not set, falls back to the culture's native name, then the code.                |
