Skip to content

Localization Guide

xADDBx edited this page May 9, 2023 · 7 revisions

Getting the localization file

To contribute to an existing localization, just add/modify the relevant file in https://github.com/cabarius/ToyBox/tree/master/ToyBox/Localization. To add a new localization, create the file (by opening the Game and going to ToyBox -> Settings -> Pick the Language -> Click "Export current locale to file"). grafik Now there should be a new file in the ToyBox\Localization directory on your PC (e.g. '\Steam\steamapps\common\Pathfinder Second Adventure\Mods\ToyBox\Localization'). That file is called {languageCode}.json. The keys in it are based on the ones from en.json in the same directory. grafik

How to contribute

Localization files consist of some MetaData and the Strings Dictionary. The Dictionary consists of a key (string in the original language) and a value (string in the translated language). At the beginning the values will be empty, you can contribute by adding the translated values or correcting existing ones. Please don't change keys and keep the original formatting when translating. When the original key has a space at the beginning but not at the end, please do that for the translated string also. Some strings might contain color or other formatting (using HTML tags), please keep those too. Once you modified the files, create a PR on GitHub with the changes. You don't have to create a complete translation in one go. If values are missing, it will just use the original keys, which means that it's not a problem if localization is done step by step.

The localization file

As mentioned earlier, the name of the localization file is {languageCode}.json. The file is saved in json format. There are 5 root elements, LanguageCode which saves the LanguageCode, Version which is the ToyBox version for which the most recent keys were added, Contributers which are the Contributers for that localization (feel free to add yourself when you contribute), HomePage which is a link to this GitHub and Strings which is a Dictionary containing the actual localization. grafik

If you have questions, just reach out to an active contributor on GitHub or on the Owlcat Discord.

Clone this wiki locally