Closed anjok closed 3 years ago
Actually, please don't pull this yet as I can't test any of this due of a lack of a configured raspi. I still need some parts.
But I can't use different branches for the different issues as I don't know your schedule and the changes almost all overlap.
So what I did here:
The next step is to generate the locales/base.dot file and add the various translations.
But if possible, don't create conflicts for me for the next few days...
Unfortunately you would need to regenerate the Chinese text from the to-be-created gettext files. Since I have no idea what the characters are, I would just create a mess and it would take ages.
@hyansuper ok, localisation seems to work now. It would be great if you could take a look.
thank you for the effort, I am looking at it. I have not used gettext before, may take a while
Please re-fetch the PR, I squashed the commits and rebased on your latest code.
Note that it's very hard for me to merge incoming changes of yours into my branch as I have no idea what your code actually spells... so please decide soon if you want to do the localisation or not. If not, I have to keep my own fork and won't be able to contribute.
I was working with this here:
https://phrase.com/blog/posts/translate-python-gnu-gettext/
it's basically:
cd rcute_cozmars_server
(wherever this is)/pygettext.py -d base -o locales/base.pot *.py *.html
Then generate loc files for each non-english language and fill in the blanks. It's really easy to use. I hacked it so that it also works in the html files.
You'd need to proofread the English (as they are the keys, they need to be pretty good and I really don't know what the text was saying before), rerun the pygettext.py and then fill in the generated Chinese.
I have a similar patch for the other two projects, but will make PRs only if you don't make changes before you pull them I just can't see what you are doing when you write Chinese :)
sorry I made some duplicated change requests
ok, will fix and push later
@hyansuper please review again.
also, see:
https://stackoverflow.com/questions/27214065/how-to-docstring-in-python-for-multiple-languages
for the doctoring comments. These would be good for the other two projects.
@anjok did you have to hack pygettext.py in order to handle .html?
I think this command also works pygettext -d base -o locales/base.pot *.py static/*.html
but a few english aren't extracted in html, especially those in javascript, maybe it has to do with "quote in quote in quoat...". I have to manually type into .pot file
Oh ok. I didn't verify it got everything. Worst case one need to put the error strings in a server side duct