-
Notifications
You must be signed in to change notification settings - Fork 36
Home
teeworlds-translation is a submodule of teeworlds.
Please read heinrich5991's instructions at https://www.teeworlds.com/forum/viewtopic.php?id=10929
-
Download your strings from Transifex
You will receive a .po file. -
Download and install Python3, and the [https://pypi.org/project/polib/] (polib) module
-
Download this python script: reconvert_l10n.py (located at teeworlds/master/scripts/reconvert_l10n.py)
-
Run the script on the .po file:
python3 reconvert_l10n.py <language>.po
This will yield you the JSON file you're looking for, to be put in <teeworlds folder>/data/languages
.
Translations are located in your Teeworlds folder in <teeworlds folder>/data/languages
, as JSON files. In order to test your new Transifex translation, you need to:
- Add/replace your
<language>.json
file (e.g.german.json
) -
If your language is new: edit
index.json
to add an entry for your language
This can help you with the context of some strings. Please try different resolutions to make sure your strings fit well and don't get truncated.
The following section is only relevant for those with Transifex maintainer access.
You need to run the convert_l10n.py
script located here: https://github.com/teeworlds/teeworlds/blob/master/scripts/convert_l10n.py, using Python3 and polib as mentioned above.
Run the script in the scripts
folder, it will recursively scan for Localize(...)
in the Teeworlds code located in the parent folder and generate a base.pot
file, to be loaded into Transifex.
If you get cannot find file or directory: base.pot
errors, you may need to replace some relative paths in the script by absolute paths on Linux.
If you get any errors within write_languagefile(outputfilename, l10n_src, old_l10n_data)
, you may comment the call out and still output a base.pot
.