[Localization] Misleading Chinese translation for TS2561 error message
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- compilers, localization
Research direction
Start by running the provided TypeScript example with tsc --locale zh-CN and inspect the localized TS2561 diagnostic. Update the Chinese wording so the property is described as absent from the PageState type, then rerun the reproduction and confirm the corrected message preserves the English meaning.
Written by the indexing model from the issue text.
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment
Hello TypeScript team,
I encountered a confusing and potentially misleading translation in the Chinese (zh-CN) diagnostic message for error TS2561.
Current Chinese message:
对象字面量只能指定已知的属性,但“comprehensiveFilterTab”中不存在类型“PageState”。是否要写入 comprehensiveFilterList?
Original English message:
Object literal may only specify known properties, but 'comprehensiveFilterTab' does not exist in type 'PageState'. Did you mean to write 'comprehensiveFilterList'?
Issue:
The Chinese translation says:
“但‘comprehensiveFilterTab’中不存在类型‘PageState’”
which literally means “but type ‘PageState’ does not exist in ‘comprehensiveFilterTab’”.
This reverses the logical relationship and is grammatically incorrect, leading developers to misunderstand the error. It should convey that the property 'comprehensiveFilterTab' does not exist in the type 'PageState', not the other way around.
Suggested correction (Chinese):
对象字面量只能指定已知属性,但“comprehensiveFilterTab”在类型“PageState”中不存在。您是否想写“comprehensiveFilterList”?
This version preserves the original meaning and uses natural, unambiguous Chinese.
How to reproduce:
Run tsc --locale zh-CN on code that triggers TS2561, e.g.:
type PageState = { comprehensiveFilterList: string[] };
const state: PageState = { comprehensiveFilterTab: [] }; // TS2561
Thank you for your attention! Accurate error messages are crucial for non-English developers.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 106
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 microsoft/TypeScript
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
microsoft/TypeScript#64322 · 2 comments · 1 reaction · 2 assignees ·
-
Possible Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64278 · 1 comment · 1 reaction ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/TypeScript#64118 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/TypeScript#64094 ·
-
Docs
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/TypeScript#63959 · 5 comments ·
All issues in microsoft/TypeScript
Similar issues
-
kind/bug needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 72/100
matrixorigin/matrixone#29223 ·
-
needs-acceptance wg/data-plane-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#4024 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
alexgorbatchev/dotfiles#107 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100