Skip to content

Localization Guide

CasDragon 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 the repository.

To add a new localization, create the file (CTRL + F10 to open UMM, Toybox -> Settings tab -> 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.

IMPORTANT: 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.

There are 5 root elements, and typically the only 2 you'll edit is Contributers (to add yourself), and Strings

  • 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
  • HomePage which is a link to this GitHub
  • 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