Skip to content

Add 公元 → 西元 conversion to s2twp#1080

Merged
frankslin merged 4 commits intomasterfrom
copilot/add-conversion-rule-gong-yuan-xi-yuan
Apr 4, 2026
Merged

Add 公元 → 西元 conversion to s2twp#1080
frankslin merged 4 commits intomasterfrom
copilot/add-conversion-rule-gong-yuan-xi-yuan

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

  • Add 公元 西元 to TWPhrases.txt and sort it
  • Add 西元 公元 to TWPhrasesRev.txt for reverse mapping (tw2sp)
  • Sort both files using data/scripts/sort.py
  • Run tests — all 16 pass

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b60846935d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread data/dictionary/TWPhrases.txt Outdated
Comment thread data/dictionary/TWPhrases.txt Outdated
Copilot AI requested a review from frankslin March 30, 2026 06:02
@danny0838
Copy link
Copy Markdown
Contributor

台灣公元西元都用,不適合強制轉換。

@frankslin
Copy link
Copy Markdown
Collaborator

在繁体语境中,「公元」是「理解但不常用」的词。台湾政府、学术和商业文本大部分是写「西元」。同时 MediaWiki 在转换台灣正體时,也将「公元」替换为「西元」。因此本次 PR 只适配了 s2twp 和 tw2sp 的模式。

不过注意到 MediaWiki 的 ZhConversion.php 中转换是这样匹配的:

'西元1' => '公元1',
'西元2' => '公元2',
'西元3' => '公元3',
'西元4' => '公元4',
'西元5' => '公元5',
'西元6' => '公元6',
'西元7' => '公元7',
'西元8' => '公元8',
'西元9' => '公元9',
'西元前' => '公元前',

或许直接转「公元」一词会覆盖比预期更广泛的文本内容。

我的想法是不妨先试试下面这样转,发现特定问题再做调整:

公元 - 西元
公元纪年 - 公元紀年

@frankslin frankslin force-pushed the copilot/add-conversion-rule-gong-yuan-xi-yuan branch from 85e1057 to c07006e Compare April 4, 2026 04:39
@frankslin frankslin merged commit 5263304 into master Apr 4, 2026
32 of 33 checks passed
@frankslin frankslin deleted the copilot/add-conversion-rule-gong-yuan-xi-yuan branch April 4, 2026 04:59
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

Successfully merging this pull request may close these issues.

4 participants