GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 引用符から鉤括弧への変換に不具合がある · Issue #774 · python-doc-ja/python-doc-ja

引用符から鉤括弧への変換に不具合がある #774

New issue
Copy link
New issue
Copy link
Closed
Closed
引用符から鉤括弧への変換に不具合がある#774
Copy link
Assignees
methane

Description

@cocoatomo
cocoatomo
opened on Oct 12, 2017
Issue body actions

ref. sphinx-doc/sphinx#4142

HTML へのビルドを行うと、この訳文 (https://github.com/python-doc-ja/py36-locale/blob/master/ja/LC_MESSAGES/bugs.po#L122) に含まれる "Title" が 」Title」 に変換されるという不具合がある。
#771 のと類似の事象だが、こちらは段落の文字列なので Sphinx 1.6.4 でも smart quotes による変換対象となってしまう。

Activity

  1. cocoatomo commented on Oct 14, 2017

    @cocoatomo
    cocoatomo
    on Oct 14, 2017
    ContributorAuthor
    More actions

    日本語で smart quotes を使うのは問題があるので、この機能を無効にすることで対応するつもりでいる。

    具体的には、Sphinx プロジェクトのルートディレクトリに次の内容を含む docutils.conf ファイルを設置する。

    [restructuredtext parser]
    smart_quotes:no
    

    ref. http://docutils.sourceforge.net/docs/user/config.html#smart-quotes

    ただし、smart quotes を無効にすると、引用符 (", ') 以外にも ---, --, ... が変換されず、そのまま出力されるようになる。

  2. cocoatomo commented on Oct 14, 2017

    @cocoatomo
    cocoatomo
    on Oct 14, 2017
    ContributorAuthor
    More actions

    @methane 対応方法について問題無いか確認してもらえますか?

  3. cocoatomo
    assigned
    methane
    on Oct 14, 2017
  4. methane commented on Oct 15, 2017

    @methane
    methane
    on Oct 15, 2017
    Contributor
    More actions

    これ、同じディレクトリで複数言語をビルドしている場合に、日本語だけで smart_quotes:no する方法はありますか?

  5. cocoatomo commented on Oct 15, 2017

    @cocoatomo
    cocoatomo
    on Oct 15, 2017
    ContributorAuthor
    More actions

    方法が1つ見付かりました。

    docutils.conf に書けるオプションとして smartquotes_locales があり、ここには引用符の置き換えに使う文字列が言語ごとに指摘できます。
    http://docutils.sourceforge.net/docs/user/smartquotes.html#smartquotes-locales

    docutils.conf に以下の内容を記述して、日本語で引用符の置き換えに使う文字を ""'' (二重引用符、二重引用符、単引用符、単引用符) に設定すれば、実質的に変換しない動作が実現できます。

    [restructuredtext parser]
    smartquotes_locales: ja: ""''
    

    これは括弧についてだけの設定なので、 ---, --, ... には smart quotes による変換がかかります。
    (smart_quotes:no とするよりもこちらの方が良いと思います。)

    実験結果

    repository URL: https://github.com/python-doc-ja/cpython-doc-intl.git
    commit hash: 87caf1ccad1457387bec57579fc742af3f2b703b
    OS: macOS 10.13
    Python ver.: 3.6.3
    Sphinx ver.: 1.6.4
    docutils ver.: 0.14
    .po ファイルは日本語のみ用意。

    日本語、smart quotes 有効、docutils.conf 無し

    ビルドコマンド: sphinx-build -j4 -D language=ja -D locale_dirs=locale -D gettext_compact=0 -A versionswitcher=1 -E -d build/doctrees . ./_build/html

    画面キャプチャ

    screen shot 2017-10-15 at 15 35 29

    フランス語、smart quotes 有効、docutils.conf 無し

    ビルドコマンド: sphinx-build -j4 -D language=fr -D locale_dirs=locale -D gettext_compact=0 -A versionswitcher=1 -E -d build/doctrees . ./_build/html-fr

    画面キャプチャ

    screen shot 2017-10-15 at 15 39 28

    日本語、smart quotes 有効、docutils.conf 有

    ビルドコマンド: sphinx-build -j4 -D language=ja -D locale_dirs=locale -D gettext_compact=0 -A versionswitcher=1 -E -d build/doctrees . ./_build/html-conf

    画面キャプチャ

    screen shot 2017-10-15 at 15 41 47

    フランス語、smart quotes 有効、docutils.conf 有

    ビルドコマンド: sphinx-build -j4 -D language=fr -D locale_dirs=locale -D gettext_compact=0 -A versionswitcher=1 -E -d build/doctrees . ./_build/html-fr-conf

    画面キャプチャ

    screen shot 2017-10-15 at 15 42 45

  6. JulienPalard commented on Oct 15, 2017

    @JulienPalard
    JulienPalard
    on Oct 15, 2017
    More actions

    Opened a PR on cpython after a full test build: python/cpython#4006

    Reacted by cocoatomo
  7. cocoatomo
    added 2 commits that reference this issue on Oct 18, 2017

    Use ASCII quotes

    07c599e

    Use ASCII quotes

    42122ed
  8. cocoatomo commented on Oct 20, 2017

    @cocoatomo
    cocoatomo
    on Oct 20, 2017
    ContributorAuthor
    More actions

    問題が全て解決したのでクローズ

  9. cocoatomo
    closed this as completedon Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @methane
    methane

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.