# ExternalFiles Mode

## ExternalFiles Mode

In **ExternalFiles Mode**, language files must be stored separately for each language in the `StreamingAssets/Languages` folder. Each language should have its own file (e.g., `en.json`, `pt-br.json`, etc.), and the files should contain translations for that specific language.

This mode allows you to easily manage translations externally, especially useful if your project needs to scale with multiple languages. The system will automatically load the appropriate file based on the selected language.

We also offer a **free editing tool** specifically built for the LanguageSystem Pro format, featuring a user-friendly layout that supports CSV, JSON, and XML formats. The tool makes it easy to edit your language files, and you can export them as a global file for use in **InternalDatabase** and **GlobalExternal** modes, or as separate files per language for **ExternalFiles** mode. For more details, check the LanguageManagerEditor section.

#### Preparing Language Files:

1. Inside the `StreamingAssets/Languages` folder, create separate files for each language.
2. Each file must follow this format:

```json
{
  "Translations": [
    {
      "TextID": "greeting",
      "TranslatedText": "Hello World"
    },
    {
      "TextID": "farewell",
      "TranslatedText": "Goodbye"
    }
  ]
}
```

* **File Naming**: The file should be named according to the language code, such as `en.json` for English, `pt-br.json` for Brazilian Portuguese, and so on.
* **TextID**: This is the unique identifier for the text entry that will be used in your game.
* **TranslatedText**: This is the actual translation for the `TextID` in the selected language.

> Note: The system will automatically look for the file that matches the current language, so make sure each language file contains the relevant translations.

#### Using WarpText with ExternalFiles Mode:

Once your language files are set up, you can use the `WarpText` component to display translated text in the game.

1. Add the `WarpText` component to any `Text` or `TextMeshProUGUI` object in your scene.
2. In the `TextID` field of the `WarpText` component, enter the `TextID` that corresponds to the translation in your language file.

When the game starts, the LanguageSystem Pro will automatically read the appropriate file from `StreamingAssets/Languages` and update the text in real time based on the selected language.

***

#### Switching Languages:

To switch between languages, the LanguageSystem Pro will dynamically load the file corresponding to the selected language (e.g., `en.json`, `es.json`) from the `StreamingAssets/Languages` folder. You can change languages using a dropdown or any other input method, and the system will reload the text from the external files in real time.

<figure><img src="/files/CbXVhbKPyHZlDsKHH0Xu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ri7Dafza05RwjnEKNTrA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/pze5p1af92I09Vf7lInF" alt=""><figcaption></figcaption></figure>

> Make sure to follow this process for all texts that you want to be translated within your game.

> **Reminder: LanguageManagerEditor Tool**
>
> We offer a **free LanguageManagerEditor tool**, specifically designed for the LanguageSystem Pro format. It has a friendly interface and supports easy import, editing, and export of files in CSV, JSON, and XML formats. You can use this tool to export global files for the **InternalDatabase** and **GlobalExternal** modes or individual files per language for **ExternalFiles** mode.
>
> For more details on using this editor, see the LanguageManagerEditor section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bizachi-dev.gitbook.io/languagesystem-pro/getting-started/publish-your-docs-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
