# Localization Editor

# Localization Editor

The Localization Editor lets you manage English (en-US) and German (de-DE) translations in a side-by-side view. All quest names, dialog lines, achievement descriptions, and UI text are stored as localization keys.

## Overview

At the top of the page you see:

- **Key counts** -- total EN and DE keys loaded
- **Missing badges** -- warnings showing how many keys are missing from each language (e.g. "12 missing DE")

## Filtering and Search

The toolbar provides several ways to find the keys you need:

| Control | What it does |
|---------|-------------|
| **Search** | Filter keys by name (case-insensitive substring match) |
| **Missing only** | Show only keys that exist in one language but not the other |
| **Modified only** | Show only keys you have changed in this session |
| **Counter** | Shows filtered count vs. total (e.g. `42 / 1200`) |

:::tip
Use "Missing only" after importing your server configs to quickly find untranslated keys that need attention.
:::

## Editing Translations

The main area is a three-column table:

| Column | Content |
|--------|---------|
| **Key** | The i18n key (e.g. `quest.desert_hunt.name`). Shown with a `mod` badge if modified. |
| **English (en-US)** | The English translation, editable inline |
| **German (de-DE)** | The German translation, editable inline |

To edit a translation:

1. Click on any EN or DE cell
2. Type the new text
3. Press Tab or click away to confirm

Modified keys are marked with a yellow left border and a `mod` badge on the key column. Missing translations show `(missing)` in red italics.

:::info
The table is virtualized for performance -- only the first 200 results are shown. If you have more than 200 matches, use the search bar to narrow down results.
:::

## Adding New Keys

1. Click **+ Add Key**
2. Enter the **Key** name (e.g. `quest.my_quest.name`)
3. Fill in the **English** and/or **German** text
4. Click **Add Key**

:::warning
If the key already exists, a warning is shown: "Key exists (will be overwritten)". Adding it will replace the existing values.
:::

## Key Naming Conventions

Follow these patterns for consistency:

| Content | Pattern | Example |
|---------|---------|---------|
| Quest name | `quest.<id>.name` | `quest.desert_hunt.name` |
| Quest description | `quest.<id>.desc` | `quest.desert_hunt.desc` |
| NPC dialog | `npc.<citizen_id>.<quest_id>.<phase>.<line>` | `npc.hunter_riven.desert_hunt.offer.0` |
| Achievement | `achievement.<id>.name` | `achievement.first_kill.name` |
| Chapter title | `chapter.<id>.title` | `chapter.prologue.title` |

## What Gets Exported

Only **new** and **modified** keys are included in the export. The editor tracks the original values of imported keys and compares against your edits. This means:

- Keys you added are exported
- Keys you changed are exported with the new value
- Keys you did not touch are not exported (the server uses its base files)

Exported files are placed in the `kyuubisoft_questbook/localization/` folder as `custom_en-US.json` and `custom_de-DE.json`.

:::tip
Remember that the server uses a file-first pattern -- custom locale files override base translations by key. Your custom file only needs to contain the keys you want to change or add, not all keys.
:::