2016-05-21 00:03:15 +00:00
|
|
|
Teeworlds language scripts by timakro
|
2015-06-30 16:57:25 +00:00
|
|
|
|
|
|
|
These scripts can help you to improve the language files. This is a short tutorial
|
|
|
|
about how to use the scripts.
|
|
|
|
|
|
|
|
|
|
|
|
You can start by analyzing the current languages using analyze.py
|
2017-07-09 07:09:14 +00:00
|
|
|
$ ./analyze.py
|
2015-06-30 16:57:25 +00:00
|
|
|
|
|
|
|
analyze.py outputs serveral columns. The column 'total' is the number of
|
|
|
|
translations in the file. 'empty' is the number of untranslated phrases in the
|
|
|
|
file. The 2nd and 3rd columns are calculated by looking into the source. The scirpt
|
|
|
|
searches through the source for all phrases. 'missing' is the number of phrases in
|
|
|
|
the source but not in the file. 'unused' is the number of phrases in the file but
|
|
|
|
not in the source.
|
|
|
|
|
|
|
|
|
|
|
|
To update a language you should first copy it using the copy_fix.py script.
|
2017-07-09 07:09:14 +00:00
|
|
|
$ ./copy_fix.py ../spanish.txt newspanish.txt --delete-unused --append-missing
|
2015-06-30 16:57:25 +00:00
|
|
|
|
|
|
|
Then you can start to modify newspanish.txt. Search in the file for the following
|
|
|
|
line and remove it:
|
|
|
|
##### generated by copy_fix.py, please translate this #####
|
|
|
|
|
|
|
|
Every phrase below this line should be empty. Now you can fill in the translations
|
|
|
|
you know. It's also okay to write just the same phrase as in english for words like
|
|
|
|
'Hookcollision' or 'Screenshot'. If you don't know how to translate something just
|
|
|
|
remove it.
|
|
|
|
|
|
|
|
That's all, you improved the translation. If you want you can add your name at the
|
|
|
|
start of the file. Now you can move the file back to its original location.
|
|
|
|
$ mv newspanish.txt ../spanish.txt
|
|
|
|
|
|
|
|
|
2016-05-21 00:03:15 +00:00
|
|
|
Often people know better phrases for translations where the english phrase was just
|
|
|
|
copied. To find these you can use find_unchanged.py
|
2017-07-09 07:09:14 +00:00
|
|
|
$ ./find_unchanged.py ../spanish.txt
|
2019-12-02 08:08:56 +00:00
|
|
|
|
|
|
|
To update all languages:
|
|
|
|
|
2020-02-12 21:39:37 +00:00
|
|
|
$ for i in data/languages/*.txt; do scripts/languages/copy_fix.py $i $i.$$.tmp --delete-unused --append-missing && mv $i.$$.tmp $i; done
|