-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locale/<language>/LC_MESSAGES/sphinx.po translation ignored #6640
Comments
So I found a work around or "proved" to myself that I didn't read the instructions completely wrong.
Open _build/html/index.html. Notice how the figure caption label is now Foobar (for testing) and the code block caption label Whatever, as expected. Of course now the rest of the internal messages are in English and I needed them in Danish. But that is also easily worked around. Just obtain a copy of the published or packaged Maybe it is related to this, I am not completely sure: #1242 If it is not a bug, it is at least unexpected behavior . If furt,her are needed to make it work (without my workaround) the documentation should be updated to mention it [2] [1] https://github.com/sphinx-doc/sphinx/blob/master/sphinx/locale/da/LC_MESSAGES/sphinx.po |
At present, @shimizukawa Which is correct the behavior or document? |
I'm not sure which is correct. IMO, it is better to override the system values with the intentionally provided |
@shimizukawa Thank you for comment. I'll change the priority of users' message catalog later. |
Our document describes that users can override system messages via their own message catalog named `sphinx.mo` under the locale_dirs. But it has not been used since its beginning of i18n mechanism because the priority of users' message catalog is lower than system's. This makes the priority of users' message catalog higher than system's.
Our document describes that users can override system messages via their own message catalog named `sphinx.mo` under the locale_dirs. But it has not been used since its beginning of i18n mechanism because the priority of users' message catalog is lower than system's. This makes the priority of users' message catalog higher than system's.
…essage Fix #6640: i18n: Failed to override system message translation
Is there a way to provide a custom |
@dbitouze You can do it. Please read the document of |
Describe the bug
I read [1] as it should be possible to add a file
locale/<language>/LC_MESSAGES/sphinx.mo
to the source dir (same dir as theMakefile
) and through that change translations or add additional translation to .When I add
locale/da/LC_MESSAGES/sphinx.po
, with updated entries forFig. %s
andListing %s
, alocale/da/LC_MESSAGES/sphinx.mo
is created (because ofgettext_auto_build = True
), but the translations are not used. The translations from the officialda
translation [2] is used. Of courselanguage = 'da'
is inconf.py
.[1] http://www.sphinx-doc.org/en/master/usage/configuration.html#confval-locale_dirs
[2] https://github.com/sphinx-doc/sphinx/blob/master/sphinx/locale/da/LC_MESSAGES/sphinx.po
To Reproduce
Steps to reproduce the behavior:
Notice that
locale/da/LC_MESSAGES/sphinx.mo
has been created. Open_build/html/index.html
.Expected behavior
The caption label for the figure
figur 1
should have beenFoobar 1
(for the sake of testing) and the caption label for the code blockViser 1
should have beenWhatever 1
(again for the sake of testing).Your project
https://github.com/jonascj/sphinx-test-locale-override.git
Screenshots
Environment info
The text was updated successfully, but these errors were encountered: