i18n: Add full support
resolves #257
- [x] Translate PO files
- [x] Generate MO files
- [x] Test with another site
This should work now. I'll test on my docs site.
Okay, this is ready for review. It works!
I've updated contributing.rst and accepted the suggestions. Not clear what to change in i18n.rst.
Quick comment: fully on board with improving the theme in this area, assuming we follow the sphinx standard practices (and @jpmckinney thanks a lot for working on this!) Will try to take a more detailed look in one of the coming days
is there a natural way to test for this infrastructure? Do most packages include translation testing in their test suite? Ideally without complicating things much?
Different projects do different things.
- If you want every PR to always be 100% translated, you can add a test using
pocount --incomplete *.poto ensure there are no untranslated strings. - If you want to ensure the POT file is up-to-date, you can have the tests run
python setup.py extract_messages --omit-header --no-locationand check for changes. Without--omit-header, thePOT-Creation-Datewill be updated by the test, causing a failure. Without--no-location, whenever lines are added to templates before translatable strings, the#:source code reference lines in the POT file will go out of date, causing a failure. - If you want to ensure the PO files are up-to-date, you can have the tests run
python setup.py update_catalog --omit-headerand check for changes.
Alternately, you can decide to do the translations steps before a release only.
Hey all - I think that this PR is an important improvement in the theme, and we don't want it to go unresolved indefinitely. Since we've already got a lot of iteration here, and since @jpmckinney has put a lot of time into this already. I suggest we go with the following steps:
- @jpmckinney rebases and resolves merge conflicts.
- We leave this PR open for 48 hours to see if there are any objections to merging it.
- We merge the PR and spot-check other i18n improvements in other issues.
@jpmckinney would you be willing to do no. 1? Sorry that this one has gone stale!
Restarted at #1192.