quarto-dev / quarto-dev/quarto-cli

`lang: zh-Hant` falls back to Simplified UI strings instead of Traditional

Open
#14,417 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-design
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Quarto's subtag-prefix resolution splits lang on - and loads most-general-first:

https://github.com/quarto-dev/quarto-cli/blob/e4b75c1a32902f6d6e01ac62752a5b7d02ec0a12/src/core/language.ts#L56-L133

For lang: zh-Hant this loads _language-zh.yml (Simplified) and then looks for _language-zh-Hant.yml (doesn't exist). Result: Traditional-script readers get Simplified UI strings — wrong script.

Quarto's _language-zh-TW.yml is Traditional in script but uses Taiwan-specific vocabulary (added deliberately in #6512 — OpenCC script conversion followed by manual region-specific corrections). A generic zh-Hant file does not exist.

Design question

How should lang: zh-Hant resolve?

  • (a) Fallback rule: if _language-zh-Hant.yml doesn't exist, try _language-zh-TW.yml. Taiwan vocabulary is closer to HK/MO than Simplified is, and this matches Pandoc's posture of shipping one generic zh-Hant file. Could be documented as best-effort until a proper generic file exists.
  • (b) Wait for a contributed generic _language-zh-Hant.yml.
  • (c) Add _language-zh-Hant.yml as a copy of the TW file. Behaviorally equivalent to (a) but less honest about regional scope.

Repro

---
lang: zh-Hant
format: html
---

Inspect generated UI strings (TOC title, "Copy to clipboard" tooltip, section titles in HTML article). They render in Simplified Chinese.

From quarto-dev/quarto-cli#14409. Related: #14416.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/core/language.ts at the subtag-prefix resolution described in the issue, then inspect _language-zh.yml and _language-zh-TW.yml. Reproduce the lang: zh-Hant example and compare the generated UI strings. Done means the selected resolution behavior is agreed, documented, and the repro renders Traditional Chinese strings without regressing existing locale behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
internationalization, localization
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.