pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

i18n: Add full support

Open jpmckinney opened this issue 5 years ago • 6 comments

resolves #257

  • [x] Translate PO files
  • [x] Generate MO files
  • [x] Test with another site

jpmckinney avatar Apr 22 '21 20:04 jpmckinney

This should work now. I'll test on my docs site.

jpmckinney avatar Apr 22 '21 22:04 jpmckinney

Okay, this is ready for review. It works!

jpmckinney avatar Apr 23 '21 01:04 jpmckinney

I've updated contributing.rst and accepted the suggestions. Not clear what to change in i18n.rst.

jpmckinney avatar Apr 24 '21 22:04 jpmckinney

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

jorisvandenbossche avatar Apr 26 '21 07:04 jorisvandenbossche

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 *.po to 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-location and check for changes. Without --omit-header, the POT-Creation-Date will 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-header and check for changes.

Alternately, you can decide to do the translations steps before a release only.

jpmckinney avatar Apr 27 '21 20:04 jpmckinney

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:

  1. @jpmckinney rebases and resolves merge conflicts.
  2. We leave this PR open for 48 hours to see if there are any objections to merging it.
  3. 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!

choldgraf avatar Aug 22 '21 21:08 choldgraf

Restarted at #1192.

jpmckinney avatar Feb 16 '23 18:02 jpmckinney