Map Chinese region codes (`zh-TW`, `zh-CN`) to script codes when passing `lang` to Pandoc
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- cli
Research direction
Start in src/command/render/pandoc.ts at the existing bare-zh rewrite, then review src/core/language.ts to confirm Quarto’s own language-file resolution remains unchanged. Reproduce with lang: zh-TW and a format using Pandoc translations, such as LaTeX/PDF with chapters. Done means the listed Chinese region codes are passed to Pandoc as the corresponding script codes without changing Quarto’s original lang value.
Written by the indexing model from the issue text.
Description
When a user sets lang: zh-TW, Pandoc emits:
[WARNING] Could not load translations for zh-TW
data file translations/zh.yaml not found
Pandoc ships only zh-Hans.yaml and zh-Hant.yaml (IETF-recommended script subtags for Chinese). Its fallback logic strips to the primary language subtag (zh), which also doesn't exist — hence the warning:
Quarto already has one special-case rewrite at pandoc invocation that rewrites bare zh to zh-Hans:
Suggestion
We could extend the mapping in pandoc.ts with region → script:
zh-TW,zh-HK,zh-MO→ passzh-Hantto Pandoczh-CN,zh-SG→ passzh-Hansto Pandoc
This would only affect the value handed to Pandoc. Quarto's own file resolution in src/core/language.ts would be unaffected — _language-zh-TW.yml would still load for users writing lang: zh-TW.
Repro
---
lang: zh-TW
---
Render any format that uses Pandoc translations (e.g. LaTeX/PDF with chapters). Warning appears in the render log.
From quarto-dev/quarto-cli#14409.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
binder bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
quarto-dev/quarto-cli#14907 · 3 comments ·
-
brand bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
quarto-dev/quarto-cli#14891 ·
-
brand bug html revealjs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14882 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
quarto-dev/quarto-cli#14875 ·
-
Percent scripts: accept raw-string (r""") and '''-delimited markdown cells, as jupytext writes them Openengines-jupyter enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
quarto-dev/quarto-cli#14850 · 2 comments ·
All issues in quarto-dev/quarto-cli
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
babalae/bettergi-scripts-list#3674 ·
-
A-Release-Notes C-Editing D-Modest S-Ready-For-Implementation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bevyengine/bevy-website#2595 ·