Sphinx: Sphinx's Korean translation breaks every build when checking the default value's type of configuration.

Created on 13 Nov 2019  ·  7Comments  ·  Source: sphinx-doc/sphinx

Describe the bug

To Reproduce
Steps to reproduce the behavior:

$ git clone https://github.com/sphinx-doc/sphinx
$ cd sphinx
$ pip install Sphinx==2.2.1
$ sed -i "s/latex_show_urls = 'footnote'/latex_show_urls = True/" doc/conf.py
$ LANG=ko_KR.UTF-8 make docs target=html
$ # Error! 

But LANG=en_US.UTF-8 and LANG=C worked well.

Expected behavior
Generate html well without error.

Your project

  • Added the reproducible code above.

Screenshots
If applicable, add screenshots to help explain your problem.

Sphinx 버전 2.2.1 실행 중
Traceback (most recent call last):
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/cmd/build.py", line 275, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/application.py", line 260, in __init__
    self.events.emit('config-inited', self.config)
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/events.py", line 103, in emit
    results.append(callback(self.app, *args))
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/config.py", line 483, in check_confval_types
    default=type(default)))
ValueError: Single '}' encountered in format string

Exception occurred:
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/config.py", line 483, in check_confval_types
    default=type(default)))
ValueError: Single '}' encountered in format string
The full traceback has been saved in /var/folders/2z/s0qpljwj7hd60f2pm1s2f7mw0000gn/T/sphinx-err-ntins5z2.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

Environment info

  • OS: macOS 10.15.1
  • Python version: 3.8.0
  • Sphinx version: 2.2.1

Additional context

bug high

Most helpful comment

Thank you for reporting. We'll ship bugfix release soon (maybe after #6821 fixed).

All 7 comments

Thanks for reporting, ping @shimizukawa

Fixed at transifex: https://www.transifex.com/sphinx-doc/sphinx-1/translate/#ko/sphinx-pot/151250896?q=text%3A'The+config+value+%60{name}\'+has'+translated%3Ayes

Thanks for transifex fix. I am not well aware of the Sphinx release process and whether this will propagate to next bugfix release without further intervention or only to next major release. Besides, I have noticed problems currently with translated strings in various languages where compiling catalogs failed due to mismatch between original and translated strings, for example:

error: sphinx/locale/fr/LC_MESSAGES/sphinx.po:1285: positional format placeholders are unbalanced
error: sphinx/locale/fr/LC_MESSAGES/sphinx.po:2420: positional format placeholders are unbalanced
compiling catalog sphinx/locale/fr/LC_MESSAGES/sphinx.po to sphinx/locale/fr/LC_MESSAGES/sphinx.mo

and then I fixed the above upstream at transifex for French. However the problematic translations where time-stamped some months ago thus I don't know why the problem was not seen before.

Other problems (this was done at my locale with your Korean fix already pulled):

$ python setup.py compile_catalog
running compile_catalog
...
error: sphinx/locale/fr/LC_MESSAGES/sphinx.po:1285: positional format placeholders are unbalanced
error: sphinx/locale/fr/LC_MESSAGES/sphinx.po:2420: positional format placeholders are unbalanced
compiling catalog sphinx/locale/fr/LC_MESSAGES/sphinx.po to sphinx/locale/fr/LC_MESSAGES/sphinx.mo
...
error: sphinx/locale/ja/LC_MESSAGES/sphinx.po:905: placeholders are incompatible
error: sphinx/locale/ja/LC_MESSAGES/sphinx.po:1271: placeholders are incompatible
error: sphinx/locale/ja/LC_MESSAGES/sphinx.po:1280: positional format placeholders are unbalanced
error: sphinx/locale/ja/LC_MESSAGES/sphinx.po:2415: incompatible format for placeholder 1: 'r' and 's' are not compatible
compiling catalog sphinx/locale/ja/LC_MESSAGES/sphinx.po to sphinx/locale/ja/LC_MESSAGES/sphinx.mo
compiling catalog sphinx/locale/ko/LC_MESSAGES/sphinx.po to sphinx/locale/ko/LC_MESSAGES/sphinx.mo
...
error: sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po:402: incompatible format for placeholder 1: 'r' and 's' are not compatible
error: sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po:3203: positional format placeholders are unbalanced
compiling catalog sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po to sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
compiling catalog sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po to sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
Compiling failed.

The fr issues I have fixed at transifex but there are apparently ja and zh_CN issues.

As said I am not familiar with release process regarding internationalization, please wait for competent maintainer.

For example at https://github.com/sphinx-doc/sphinx/blob/c7fd4cc82701baf26e1f2a4cc5812b97e91374d3/sphinx/locale/ja/LC_MESSAGES/sphinx.po#L903-L906

The in translated string is wrong Unicode percent sign in place of %. It could be at transifex the %r place holder got somehow not distinguished from plain text. (looks to me for French as having been the case)

I also fixed Japanese translations on transifex. And fetch them all via #6823.

Thank you for reporting. We'll ship bugfix release soon (maybe after #6821 fixed).

Thanks for applying this patch early with v2.2.2.

@tk0miya Sorry for bothering again. I missed one more typo error during translation.

Exception occurred:
  File "/Users/minhoryang/.anyenv/envs/pyenv/versions/3.7.4/envs/3.7.4-konlpy/lib/python3.7/site-packages/sphinx/config.py", line 482, in check_confval_types
    default=type(default)))
KeyError: 'current '

It needs to reopen by following changes required:

  • original: {current .__name__}
  • after fix: {current.__name__}

(I applied this to Transifex.)

스크린샷 2019-12-03 오후 9 58 13

Was this page helpful?
0 / 5 - 0 ratings