> For the complete documentation index, see [llms.txt](https://bizachi-dev.gitbook.io/bullethell-elemental-template/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bizachi-dev.gitbook.io/bullethell-elemental-template/user-interface-menus/language-manager.md).

# Language Manager

Translations, fonts per language and the components that translate the UI.

The template is translated into **English, Portuguese, Chinese, Japanese and Korean**. The translations are handled by LanguageSystemPro, a separate asset included with the template. Its full documentation is at [bizachi-dev.gitbook.io/languagesystem-pro](https://bizachi-dev.gitbook.io/languagesystem-pro).

The **LanguageManager** object of the Login scene holds the languages and the text entries. The player picks the language on the login screen or in the profile menu, and the choice is saved.

<figure><img src="https://215355839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fc8AVbPtcUOjcVrQx9Eyu%2Fuploads%2Fgit-blob-227c3e1e701710a478a33db3e5010ba371289612%2Fv16-language-manager.png?alt=media" alt="Language Manager in the Inspector"><figcaption></figcaption></figure>

### Debug Settings

| Field                      | What it does                                                                                             |
| -------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Disable TMP Warnings**   | Hides TextMesh Pro warnings in the console.                                                              |
| **Enable Text Formatting** | Converts `\n` into a line break and `[b]...[/b]`, `[i]...[/i]` into bold and italic in translated texts. |

### Mode Settings

| Field                   | What it does                                                                                                                                                                                              |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Language Mode**       | Keep **Internal Database**. The template shows error messages and texts built by code, which need the internal lists. The external file modes read files from `StreamingAssets` and do not work on WebGL. |
| **Current Language ID** | Default language (`en`) for a player who never picked one.                                                                                                                                                |

### Language Data

**Languages**: one entry per language.

| Field                            | What it does                                                                                                     |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Language ID**                  | Short id used everywhere: `en`, `pt`, `zh`, `ja`, `ko`.                                                          |
| **Language Title**               | Name shown in the language dropdown.                                                                             |
| **Language Icon**                | Optional flag or icon.                                                                                           |
| **Change Font On Swap**          | Swaps the font of every translated text when this language is selected. Needed for Chinese, Japanese and Korean. |
| **Font Asset Text Mesh**         | TextMesh Pro font for this language.                                                                             |
| **Font Asset**                   | Font for legacy UI Text components.                                                                              |
| **Apply Bold / Apply Uppercase** | Forces bold or uppercase on every translated text.                                                               |

**Text Entries**: one entry per text, with a **Text ID** and one translation per language. The template ships about 160 entries (login, loading, menus, errors...).

### Import / Export

The buttons at the bottom export all texts to **JSON**, **CSV** or **XML**, and import them back. A CSV opens in any spreadsheet, which is the easiest way to send the texts to a translator.

{% hint style="warning" %}
Export a backup before you import.
{% endhint %}

***

### Translating a text in the UI

Add the **WarpText** component to an object with a TextMeshPro text and set its **Text ID** to an entry of the list. The text, font, bold and uppercase follow the selected language. Similar components exist for dropdowns (**WarpDropdown**) and input fields (**WarpInputField**).

### Texts inside ScriptableObjects

Most assets have a **Translated** array next to their text (for example **Title Translated** on a quest, **Coin Name Translated** on a currency). Add one element per language with its **Language Id** and the translated text. A language without an entry shows the base text.

### Adding a new language

1. Add an entry to **Languages** with a new id (for example `es`) and a font that has the characters you need.
2. Add the translation for that id to each Text Entry.
3. Add the id to the **Translated** arrays of your assets where you want a translated text.

{% hint style="info" %}
The Chinese, Japanese and Korean fonts are large. If your game does not use those languages, remove them from **Languages** and from the TextMesh Pro fallback font lists to make the build smaller.
{% endhint %}
