Skip to content

Terms not in glossary #56

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

Closed
JulienPalard opened this issue Nov 7, 2018 · 6 comments
Closed

Terms not in glossary #56

JulienPalard opened this issue Nov 7, 2018 · 6 comments

Comments

@JulienPalard
Copy link
Member

JulienPalard commented Nov 7, 2018

Got some errors while building docs for docs.python.org:

/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:213:<translated>:1: WARNING: term not in glossary: 装饰器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:409:<translated>:1: WARNING: term not in glossary: 迭代器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:797:<translated>:1: WARNING: term not in glossary: 迭代器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:862:<translated>:1: WARNING: term not in glossary: 可迭代对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:896:<translated>:1: WARNING: term not in glossary: 可迭代对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:964:<translated>:1: WARNING: term not in glossary: 文件对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:967:<translated>:1: WARNING: term not in glossary: path-like 对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:999:<translated>:1: WARNING: term not in glossary: 通用换行

(What about setting a travis builder to check for those? Like https://github.com/python/python-docs-fr/blob/3.7/.travis.yml but without pospell?)

@adrianliaw
Copy link
Collaborator

@JulienPalard The terms seem to be like the ones from zh_CN as they are in Simplified Chinese, could you please confirm that it's from python-docs-zh-tw? I don't think the translations in library/functions are loaded in the build since they're mostly fuzzy (I manually set them when I converted them from zh_CN with OpenCC), I don't really get any warnings when I locally build the document in python-docs-zh-tw, I do check for warnings on every single merge.

But setting up Travis CI is a honking great idea, I would like to set it up so it checks for Sphinx warnings and space usage etc. automatically.

@JulienPalard
Copy link
Member Author

could you please confirm that it's from python-docs-zh-tw

Yes, I found them in the build logs of zh-tw, see the filename in my first message.

Also, I see them:

mdk@windhowl (3.7)$ git grep -n 'term.*迭代器'
library/functions.po:903:"返回一個列舉物件。*iterable* 必須是一個序列,或 :term:`迭代器`,或其他支援迭"
library/functions.po:1477:"返回一個 :term:`迭代器` 物件。根據是否存在第二個實參,第一個實參的解釋是非常"
mdk@windhowl (3.7)$ pwd
/home/mdk/clones/python-docs-zh-tw

@adrianliaw
Copy link
Collaborator

Also, I see them:

mdk@windhowl (3.7)$ git grep -n 'term.*迭代器'
library/functions.po:903:"返回一個列舉物件。*iterable* 必須是一個序列,或 :term:`迭代器`,或其他支援迭"
library/functions.po:1477:"返回一個 :term:`迭代器` 物件。根據是否存在第二個實參,第一個實參的解釋是非常"
mdk@windhowl (3.7)$ pwd
/home/mdk/clones/python-docs-zh-tw

This is indeed from python-docs-zh-tw, I've fixed these in 206544e.

One question, does docsbuild include fuzzy translations?

Yes, I found them in the build logs of zh-tw, see the filename in my first message.

Yes I saw the file names are of zh-tw, but the error messages are clearly not from the latest python-docs-zh-tw. If you do git grep on all the problematic terms except for 迭代器 (this is by OpenCC's dictionary identical in zh-tw and zh-cn), you'll find nothing. If the errors still show up anyways, could you show me the commit hash of the cloned python-docs-zh-tw if possible? Thanks!

@JulienPalard
Copy link
Member Author

One question, does docsbuild include fuzzy translations?

I don't think so.

I'm on 206544e
I'm getting:

# 2018-11-11 23:19:10.883742
# Command ['make', '-C', '/srv/docsbuild/3.7/cpython-zh-tw/Doc', 'PYTHON=/srv/docsbuild/venv/bin/python', 'SPHINXBUILD=/srv/docsbuild/venv/bin/sphinx-build', 'BLURB=/srv/docsbuild/venv/bin/blurb', 'VENVDIR=/srv/docsbuild/venv', 'SPHINXOPTS=-D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/srv/docsbuild/3.7/locale -D language=zh_TW -D gettext_compact=0', 'autobuild-stable-html'] ran successfully:make: Entering directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'
make[1]: Entering directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'
make html SPHINXOPTS='-D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/srv/docsbuild/3.7/locale -D language=zh_TW -D gettext_compact=0 -Ea -A daily=1 -A switchers=1'
make[2]: Entering directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
/srv/docsbuild/venv/bin/sphinx-build -b html -d build/doctrees -D latex_elements.papersize= -D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/srv/docsbuild/3.7/locale -D language=zh_TW -D gettext_compact=0 -Ea -A daily=1 -A switchers=1 . build/html 
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:213:<translated>:1: WARNING: term not in glossary: 装饰器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:409:<translated>:1: WARNING: term not in glossary: 迭代器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:797:<translated>:1: WARNING: term not in glossary: 迭代器
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:862:<translated>:1: WARNING: term not in glossary: 可迭代对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:896:<translated>:1: WARNING: term not in glossary: 可迭代对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:964:<translated>:1: WARNING: term not in glossary: 文件对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:967:<translated>:1: WARNING: term not in glossary: path-like 对象
/srv/docsbuild/3.7/cpython-zh-tw/Doc/library/functions.rst:999:<translated>:1: WARNING: term not in glossary: 通用换行

Build finished. The HTML pages are in build/html.
make[2]: Leaving directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'
make[1]: Leaving directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'
make: Leaving directory `/srv/docsbuild/3.7/cpython-zh-tw/Doc'

Looks like I can reproduce it locally:

(3.7.1) mdk@windhowl (master)$ make '-C' '/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc' 'VENVDIR=/home/mdk/clones/docsbuild-scripts/build_root/venv' 'SPHINXOPTS=-D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/home/mdk/clones/docsbuild-scripts/build_root/3.7/locale -D language=zh_TW -D gettext_compact=0' 'autobuild-stable-html'
make: Entering directory '/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc'
make[1]: Entering directory '/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc'
make html SPHINXOPTS='-D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/home/mdk/clones/docsbuild-scripts/build_root/3.7/locale -D language=zh_TW -D gettext_compact=0 -Ea -A daily=1 -A switchers=1'
make[2]: Entering directory '/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc'
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=/home/mdk/clones/docsbuild-scripts/build_root/venv/bin:$PATH sphinx-build -b html -d build/doctrees -D latex_elements.papersize= -D latex_engine=platex -D latex_elements.inputenc= -D latex_elements.fontenc= -j4 -q -D locale_dirs=/home/mdk/clones/docsbuild-scripts/build_root/3.7/locale -D language=zh_TW -D gettext_compact=0 -Ea -A daily=1 -A switchers=1 . build/html 
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:213:<translated>:1: WARNING: term not in glossary: 装饰器
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:409:<translated>:1: WARNING: term not in glossary: 迭代器
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:797:<translated>:1: WARNING: term not in glossary: 迭代器
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:862:<translated>:1: WARNING: term not in glossary: 可迭代对象
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:896:<translated>:1: WARNING: term not in glossary: 可迭代对象
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:964:<translated>:1: WARNING: term not in glossary: 文件对象
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:967:<translated>:1: WARNING: term not in glossary: path-like 对象
/home/mdk/clones/docsbuild-scripts/build_root/3.7/cpython-zh-tw/Doc/library/functions.rst:999:<translated>:1: WARNING: term not in glossary: 通用换行
[...]

(3.7.1) mdk@windhowl (master)$ git -C /home/mdk/clones/docsbuild-scripts/build_root/3.7/locale/zh_TW/LC_MESSAGES/ show | head -n 1
commit 206544eee7b05f9e8cab60f44a70682834c154c1

But yess I can't find them in functions.po, that's strange. Tried after a git clean in my cpython clone, the same. Hum the path-like one from lie 967 is in a fuzzy string, and my eyes read path-like object, while sphinx sees path-like 对象 that's strange.

@JulienPalard
Copy link
Member Author

JulienPalard commented Nov 12, 2018

According to strace, sphinx is fallbacking to zh_CN for this translation. Is it a good idea?

@zhsj
Copy link

zhsj commented Nov 12, 2018

As I understand correctly for docsbuild-scripts, it builds every language in its own dir, why and how can sphinx find other language's po files?

beccalzh pushed a commit to beccalzh/python-docs-zh-tw that referenced this issue Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants