i18n: disable default smartquotes for zh_CN and zh_TW (#12875)

This commit is contained in:
khanxmetu
2024-09-28 01:18:54 +03:00
committed by GitHub
parent 5b8408aac7
commit 0a162fa8da
3 changed files with 28 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ Incompatible changes
Code-blokcs are unchanged as FreeMono is now loaded with ``Scale=0.9``.
An adjustement to existing projects is needed only if they used a custom
:ref:`fontpkg` configuration and did not set :ref:`fvset`.
* #12875: Disable smartquotes for languages: ``zh_CN`` and ``zh_TW`` by default.
Deprecated
----------

View File

@@ -271,7 +271,7 @@ class Config:
'smartquotes': _Opt(True, 'env', ()),
'smartquotes_action': _Opt('qDe', 'env', ()),
'smartquotes_excludes': _Opt(
{'languages': ['ja'], 'builders': ['man', 'text']}, 'env', ()),
{'languages': ['ja', 'zh_CN', 'zh_TW'], 'builders': ['man', 'text']}, 'env', ()),
'option_emphasise_placeholders': _Opt(False, 'env', ()),
}

View File

@@ -86,6 +86,32 @@ def test_ja_html_builder(app):
assert '<p>-- &quot;Sphinx&quot; is a tool that makes it easy ...</p>' in content
@pytest.mark.sphinx(
'html',
testroot='smartquotes',
freshenv=True,
confoverrides={'language': 'zh_CN'},
)
def test_zh_cn_html_builder(app):
app.build()
content = (app.outdir / 'index.html').read_text(encoding='utf8')
assert '<p>-- &quot;Sphinx&quot; is a tool that makes it easy ...</p>' in content
@pytest.mark.sphinx(
'html',
testroot='smartquotes',
freshenv=True,
confoverrides={'language': 'zh_TW'},
)
def test_zh_tw_html_builder(app):
app.build()
content = (app.outdir / 'index.html').read_text(encoding='utf8')
assert '<p>-- &quot;Sphinx&quot; is a tool that makes it easy ...</p>' in content
@pytest.mark.sphinx(
'html',
testroot='smartquotes',