# Creating your mod: The Localization editor

The localization editor is used to translate the game. The base game's localization files are stored within the `locales` folder (ignore the `.pak` and `.pak.info` files, those are used by nw.js) .&#x20;

They are standard `.csv` files, which does mean that they can be opened and edited with Excel (and any text editor) - however Bonds has a few quirks that make the localization editor the preferred way of editing these files.

## Usage

The first two `ID` and `Context` columns are mandatory:

* The `ID` column contains the unique identifiers of each localization line. In the game, the code prompts the localization manager with this identifier in order to get the text in the correct language.
* The `Context` column is there for optional context, the column is mandatory but does not necessarily need to be filled for every line. It is used to describe what or where the localization line is, as the ID isn't always meaningful.

Columns starting from the third column are the languages/locales columns. These columns must be named according to a `[country code]-[language code]` pattern, where the country code is the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) code of the country, and the language code is the [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes#Table) code of the language.&#x20;

For example, American English is `en-US`, and British English is `en-GB` . An exhaustive list of these combinations can also be found at [https://www.fincher.org/Utilities/CountryLanguageList.shtml](https://www.fincher.org/Utilities/CountryLanguageList.shtml)

{% hint style="info" %}
While in the localization editor, the changes you make are updated in real time. You do not need to restart the game to see how your localization displays. (Although if you've made changes to the localization lines of the screen you are currently on, you likely will need to exit and come back to the screen).

Do remember to save your file, the changes may be updated in real time but they are not saved in real time.
{% endhint %}

### Shortcuts

You can use the following shortcuts:

* `Shift` + `Left Click` to select all lines or columns between the currently selected one and the clicked one
* `Control` + `Left Click` to select multiple lines or columns one by one (can also deselect already selected lines)
* `Escape` to clear the selection
* `Delete` to clear or delete the selected lines or columns (you will be prompted for confirmation)

## Modding the localization

Modding the localization is straightforward, once you've finished writing the lines, create a `locales` folder at the root of your mod (where your mod's descriptor is) and save the localization file in it. You can put the file within nested folders if you wish, as long as the folder it is in is within the `locales` folder, it will be loaded.

If your mod defines localization line IDs that already exist, the lines that already exist will be overwritten with your mod's new lines. However, If the existing line has language columns that your mod does not specify, those will be left untouched (you can see how the example mod only defines a `fr-FR` column).

{% hint style="info" %}
If you add a new language, make sure to also add a flag icon for it by creating a `img/menus/LocalesFlags` folder at the root of your mod, and putting the flag's `.png` in it (download a pack at [https://flagpedia.net/download/icons](https://flagpedia.net/download/icons) , choose "original" and "same width" format and download "Big icons, same width", then find the language's relevant country flag in there and rename it to the code of the language column)
{% endhint %}
