i18n: Translated msgid strings in content files not merged into HTML output

52 views
Skip to first unread message

Mark Peters

unread,
Oct 3, 2019, 12:56:10 PM10/3/19
to sphinx-users
Since upgrading from Sphinx 1.8 to 2.1, the translated strings in the PO files in my /locale/<language>/LC_MESSAGES/ directory are no longer merged into the HTML output. However, the translated strings for my RTD theme are merged into the output. I've upgraded my copy of sphinx-intl to v2.0.0 in case that was the issue; it isn't. 

I'm following the same process as before the Sphinx upgrade:

1. Run make gettext to produce a set of POT files.
2. Run sphinx-intl update -p build/locale -l de (to produce PO files for German translation).
3. Translate the strings. For example:

#: ../../source/index.rst:8
msgid "English string"
msgstr "German string"

4. Run the command to build my HTML output:

make -e SPHINXOPTS="-D language='de' -D locale_dirs='locale/,_themes/rtd_theme/locale/' -D html_theme='rtd_theme'" BUILDDIR="build/de" clean html

Sphinx creates the MO files from my PO files. The HTML output shows the translated strings for my theme but not for my content files.

Any idea how I could troubleshoot this issue?

Thanks in advance for any suggestions.

Mark

Aliahegr Javadi

unread,
Oct 4, 2019, 1:41:16 PM10/4/19
to sphinx...@googlegroups.com

Hi i cheng for ever having you
Plase for fllowers erve good  perogram. Writing
Isee and go
Thankyou
Aliasghar javadi

در 2019 10 3 20:26، "'Mark Peters' via sphinx-users" <sphinx...@googlegroups.com> نوشت:
--
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 sphinx-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/1f2d0815-6f52-41c5-80d6-3db732d9c41a%40googlegroups.com.

Mark Peters

unread,
Oct 10, 2019, 3:10:20 PM10/10/19
to sphinx-users
When I downgrade my environment and use Python 2.7 tools to build translated output (into German), Sphinx successfully replaces the strings in my RST files with the corresponding strings in my PO files in the HTML output:
  • Python 2.7
  • Sphinx 1.8.4
  • Sphinx-intl 0.9.9
However, when I switch back to the Python 3 tools, Sphinx does replace the strings in my RTD theme sphinx.po file but does not replace the strings in my RST content files (index.po, <filename>.po):
  • Python 3.5
  • Sphinx 2.2.0
  • Sphinx-intl 2.0.0
I don't see any earlier reports of similar issues. Any idea what could be going on? The msgid strings in my PO files line up with the strings in my RST files, so that isn't the issue.

Thanks in advance for any help.

Mark

Komiya Takeshi

unread,
Oct 12, 2019, 1:20:41 AM10/12/19
to sphinx...@googlegroups.com
Hi,

Could you file an issue to GitHub and share reproducible (minimal)
example please? Then I'll investigate it.

Thanks,
Takeshi KOMIYA

2019年10月11日(金) 4:10 'Mark Peters' via sphinx-users
<sphinx...@googlegroups.com>:
> --
> 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 sphinx-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/e700652f-2951-4d89-8ce5-c1cc7c0a58b9%40googlegroups.com.

Mark Peters

unread,
Oct 14, 2019, 3:54:20 PM10/14/19
to sphinx...@googlegroups.com
Hi Takeshi

> Could you file an issue to GitHub and share reproducible (minimal) example please? Then I'll investigate it.

> Thanks,
> Takeshi KOMIYA

Done. 

i18n: Translated msgid strings in content files not merged into HTML output #35

Thanks,
Mark

You received this message because you are subscribed to a topic in the Google Groups "sphinx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sphinx-users/Z9fN9BUQHyQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/CAFmkQAMnjfhhjeoY53_rqcHZXN-qTFuC-ZAfmr%2BsF4Ur0A0iww%40mail.gmail.com.


--
Mark Peters
Sr Technical Writer

MOBILE  +1 410 292 4719 
EMAIL  mark....@snowflake.com 

 
Snowflake Inc.
Baltimore, MD 21214
Reply all
Reply to author
Forward
0 new messages