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) .
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 code of the country, and the language code is the ISO 639-1 code of the language.
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
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.
Shortcuts
You can use the following shortcuts:
Shift
+Left Click
to select all lines or columns between the currently selected one and the clicked oneControl
+Left Click
to select multiple lines or columns one by one (can also deselect already selected lines)Escape
to clear the selectionDelete
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).
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 , 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)
Last updated