# Text strings

## Overview

All text strings used in equipment descriptions are stored in a single internationalization file. To translate the mod to another language, you must manually edit this file and change the language setting to match your target language.

***

### Translation File

**Location:** `scripts/config/DynamicEquipmentDescription/i18n.lua`

This file contains all text strings organized by category. Each section must be translated individually.

> **Why is it called i18n?**
>
> The term **“i18n”** is a widely recognized abbreviation for **internationalization**.
>
> This convention is used in many software projects to indicate that a feature or file is related to language localization and translation.\
> In this context, the `i18n.lua` file contains all the translatable text strings used by the mod, making it easier to adapt the content for different languages.

***

### File Structure

The `i18n.lua` file is organized into the following sections:

#### <mark style="color:$primary;">common</mark>

General labels used throughout the interface.

**Example:**

```lua
common = {
    category = "Category",
    type = "Type",
    license = "License",
    hitsFlying = "Hits Flying",
    element = "Element",
    onhit = "Hit",
    onequip = "Equip",
    immunity = "Immunity"
}
```

#### <mark style="color:$primary;">activeAttributes</mark>

Names for active equipment attributes (stats that appear on weapons/armor).

**Example:**

```lua
activeAttributes = {
    range = "Range",
    defense = "Defense",
    attackPower = "Attack Power",
    evadeShield = "Evade",
    -- ...
}
```

#### <mark style="color:$primary;">linkedAttributes</mark>

Names for linked attributes (character stats).

**Example:**

```lua
linkedAttributes = {
    maxHp = "Max HP",
    maxMp = "Max MP",
    strength = "Strength",
    -- ...
}
```

#### <mark style="color:$primary;">s14Attributes</mark>

Texts related to gagicks, items and technicks attributes.

**Example:**

```lua
linkedAttributes = {
    mpOrMistCost = "MP Cost",
    areaOfEffectRange = "AOE Range",
    accuracyRate = "Accuracy Rate",
    -- ...
}
```

#### <mark style="color:$primary;">effects</mark>

Names for all status effects and conditions.

**Example:**

```lua
effects = {
    ko = "KO",
    poison = "Poison",
    blind = "Blind",
    -- ...
}
```

#### <mark style="color:$primary;">categories</mark>

Names for equipment categories.

**Example:**

```lua
categories = {
    sword = "Sword",
    greatsword = "Greatsword",
    shield = "Shield",
    -- ...
}
```

#### <mark style="color:$primary;">s14Categories</mark>

Texts related to gagicks, items and technicks categories.

**Example:**

```lua
categories = {
    magick = "Magick",
    technick = "Technick",
    items = "Item",
    -- ...
}
```

#### <mark style="color:$primary;">types</mark>

Equipment type descriptions.

**Example:**

```lua
types = {
    sword = "Standard",
    greatSword = "Standard",
    katana = "Magick",
    -- ...
}
```

#### <mark style="color:$primary;">affinityTypes</mark>

Affinity type labels.

**Example:**

```lua
affinityTypes = {
    absorb = "Absorb",
    halve = "Halve",
    weak = "Weak",
    -- ...
}
```

#### <mark style="color:$primary;">elements</mark>

Element names.

**Example:**

```lua
elements = {
    fire = "Fire",
    ice = "Ice",
    lightning = "Lightning",
    -- ...
}
```

#### <mark style="color:$primary;">augments</mark>

Augment names and descriptions.

**Example:**

```lua
augments = {
    broadSword = "Broadsword",
    -- ...
}
```

#### <mark style="color:$primary;">equipments</mark>

Individual equipment names and custom descriptions for specific items. Each equipment entry has 3 properties:

* `name` - Equipment name
* `license` - Required license
* `notes` - Custom description text

**Example:**

```lua
equipments = {
    [349] = {
        name = "Argyle Armlet",
        license = "Accessories 3",
        notes = "Grants immunity to Blind and reduces Dark damage taken by half."
    },
    ...
}
```

#### <mark style="color:$primary;">items</mark>

Individual items names and custom descriptions for specific items. Each item entry has 3 properties:

* `name` - Equipment name
* `statusPrefix`- Custom text for status verb
* `notes` - Custom description text

**Example:**

```lua
items = {
    [88] = {
        name = "Phoenix Down",
        license = "Removes",
        notes = "Revive one KO'd ally."
    },
    ...
}
```

#### <mark style="color:$primary;">magicks</mark>

Individual magick names and custom descriptions for specific items. Each magick entry has 4 properties:

* `name` - Equipment name
* `license` - Required license
* `statusPrefix`- Custom text for status verb
* `notes` - Custom description text

**Example:**

```lua
magicks = {
    [1] = {
        name = "Blindna",
        license = "White Magick 1",
        statusPrefix = "Removes",
        notes = "Remove Blind from one ally."
    },
    ...
}
```

#### <mark style="color:$primary;">technicks</mark>

Individual technick names and custom descriptions for specific items. Each technick entry has 4 properties:

* `name` - Equipment name
* `license` - Required license
* `statusPrefix`- Custom text for status verb
* `notes` - Custom description text

**Example:**

```lua
magicks = {
    [1] = {
        name = "Horology",
        license = "Horology",
        statusPrefix = "Inflicts",
        notes = "Deal damage based on a factor of time to all foes in range."
    },
    ...
}
```

{% hint style="danger" %}

### Important

If you use any mod that changes the order or names of equipment, some items might show up with incorrect names.\
To fix this, you’ll need to edit the equipment texts to match the order used by the mod you’re playing with, since the default order follows the vanilla game.
{% endhint %}

***

### How to Translate

#### Set Language

In `config.lua`, set the language to your target:

```lua
language = "es"  -- For Spanish
```

#### Edit texts in i18n.lua

Open `scripts/config/DynamicEquipmentDescription/i18n.lua` and translate all text strings:

**Example:**

```lua
-- Before (English)
common = {
    category = "Category",
    type = "Type",
    license = "License"
}

-- After (Spanish)
common = {
    category = "Categoría",
    type = "Tipo",
    license = "Licencia"
}
```

#### Translate All Sections

You can translate every section in the file:

* common
* activeAttributes
* linkedAttributes
* effects
* categories
* types
* affinityTypes
* elements
* augments
* equipments
* items
* magicks
* technicks

The output will be saved to the corresponding language path based on your `language` setting.

***

### Important Notes

* The `language` setting in `config.lua` only controls **where** the file is generated, not what language the text is in.
* All translations must be done manually in `i18n.lua` .
* Make sure to maintain the Lua table structure when editing.
* Keep the keys (left side) <mark style="color:red;">**unchanged**</mark>, only translate the values (right side)

```lua
-- CORRECT
category = "Catégorie",  -- Key stays "category", value is translated

-- WRONG
catégorie = "Catégorie",  -- Don't translate the key!
```

***

### Example

<figure><img src="https://1760694555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZOPtaIH13MsIadaM9WVT%2Fuploads%2FwZqtEuo4usrhBhAq6Zuu%2Fimage.png?alt=media&#x26;token=b99eca91-74c0-4819-836a-b649b0553c31" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1760694555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZOPtaIH13MsIadaM9WVT%2Fuploads%2FETrTiWcpCsIo7YSpizbD%2Fimage.png?alt=media&#x26;token=9c5ab3bf-1c6a-4984-b25c-4ddf3770200d" alt=""><figcaption></figcaption></figure>
