> For the complete documentation index, see [llms.txt](https://glitch9.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glitch9.gitbook.io/docs/unity-assets/ai-dev-kit-spreadsheets/getting-started.md).

# Getting Started

### Requirements

**Smart Localization** requires the 'AI Development Kit' asset to function. Please ensure this asset is installed before using **Smart Localization**. If you do not have 'AI Development Kit' installed yet, you can download it from the Unity Asset Store [here.](https://assetstore.unity.com/packages/tools/ai-ml-integration/ai-toolkit-for-unity-281225)[ ](https://assetstore.unity.com/preview/281225/917274)

### Getting Started

Smart Localization settings are managed through the Unity Preferences window. Follow these steps to configure your localization settings:

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfvxAoImCwn8X43k6o7qfsPu4jqaq7HHRxhoU3J1F0ihTPpg3resnbtfb-SxH-043YuZuc-bU2F7blEjpq2hVezKMTmBEq9N1vDYzKhacrBaB4U1KDypMm71mHmMN_hkKFZl2vRRiV-JcuziytZVMDJCX4?key=IWkPO0by-aExi5LMhzB8_w" alt=""><figcaption></figcaption></figure>

**1. Open Preferences:**

* In Unity, navigate to Edit > Preferences... (on macOS, Unity > Preferences...).
* In the Preferences window, select Glitch9 > Smart Localization.

**2. General Settings:**

* Default Locale: Set the default language for your project.
* Localization Source: Choose the source for your localization data (e.g., Addressables).
* Addressable Group: Specify the addressable group that contains the localization tables.

**5. Contributors:**

* Manage the list of contributors to your localization data.

**6. Locales:**

* Available Locales: Configure the default set of locales available for use in the localization system.
* Supported Locales: Specify the locales included in the current version of the project.

### Basic Usage

**1. Set the Current Locale:**

First, set the locale that your application will use for localization. This can be done using the `LocalizationManager.CurrentLocale` property.

```csharp
// Set the current locale to French
LocalizationManager.CurrentLocale = new Locale(SystemLanguage.French);
```

**2. Localize Strings:**

Use the provided extension methods to localize strings based on the current locale. The Localize extension method can be used to fetch the localized version of a string.

```csharp
// Localize a string key using the default table
string localizedText = "hello_world".Localize();

// Localize a string key using a specified table
string localizedTextFromTable = "greeting".Localize("myCustomTable");
```

**3. Localize DateTime:**

The Localize extension method for `DateTime` allows you to format dates and times according to the current locale.

```csharp
DateTime currentDate = DateTime.Now;

// Localize DateTime to the current locale with default format
string localizedDate = currentDate.Localize();

// Localize DateTime to the current locale with a specific format
string localizedDateWithFormat = currentDate.Localize(DateTimeFormat.FullDateWithDay);
```

**4. Localize Enums:**

To localize enums, you need to use the `LocalizedEnumAttribute` to specify the table name for the enum values. Then, you can use the Localize extension method for enums.

```csharp
// Define the enum with the LocalizedEnum attribute
[LocalizedEnum("DaysTable")]
public enum DaysOfWeek
{
    Monday,
    Tuesday,
    Wednesday,
    Thursday,
    Friday,
    Saturday,
    Sunday
}

// Localize an enum value
string localizedDay = DaysOfWeek.Monday.Localize();
```
