It turns out this works if I set the language to `en` and change `locale/da/` to `locale/en`, so I submitted an issue about it: https://github.com/sphinx-doc/sphinx/issues/6640
It seems like an unexpected behavior at least. On Tuesday, August 13, 2019 at 12:44:02 AM UTC+2, Jonas Camillus Jeppesen wrote: > > Hi everyone, > > I'm dissatisfied with certain Danish translations of the internal sphinx > messages, so I am trying to overwrite a few select ones locally, but it is > not working. My locally changed translations are not used. > I'd appreciate it if someone would take a look at my minimal working > example and tell me if I'm doing something wrong. > > My minimal working example is here: https://yapb.in/ramN.zip : it is just > the output of `sphinx-quickstart`, an added `.. code-block::`, added file > locale/da/LC_MESSAGES/sphinx.po and modified conf.py. > > To build it (have sphinx 1.8 or 2.0 installed): > unzip test-locale.zip > cd test-locale > make html > > Here is what I am doing and why I think it should workd. This > http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-locale_dirs > > directly states that internal message translations will be fetched from " > ./locale/*language*/LC_MESSAGES/sphinx.mo" (compiled from sphinx.po file > using msgfmt). > > So I added a "locale/da/LC_MESSAGES/sphinx.po to the root of the demo > project (created by sphinx-quickstart). The content of the sphinx.po file > is taken from > https://github.com/sphinx-doc/sphinx/blob/master/sphinx/locale/da/LC_MESSAGES/sphinx.po > > but with updated values which should be easy to spot i the output. > > conf.py contains the following: > > language = 'da' > locale_dirs = ['locale/'] > gettext_auto_build = True > gettext_compact = False > > If I build the html (make html) an .mo file > "locale/da/LC_MESSAGES/sphinx.mo" is created (because of the > gettext_auto_build option), so I figure I'm doing something right. Anyway, > the html output does not use the translations. "Listing x.y" is still > translated as "Viser x.y" not "ShowYourSelf x.y" etc. > > Any help would be appreciated. > > / Jonas > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/722c99df-8301-4b19-b0a1-fc2515dc4ffc%40googlegroups.com.
