microsoft / microsoft/TypeScript
[Localization] Misleading Chinese translation for TS2561 error message
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
### Acknowledgement
- [x] 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.:
```ts
type PageState = { comprehensiveFilterList: string[] };
const state: PageState = { comprehensiveFilterTab: [] }; // TS2561
```
Thank you for your attention! Accurate error messages are crucial for non-English developers.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo l’esempio TypeScript fornito con tsc --locale zh-CN e analizza la diagnostica TS2561 localizzata. Aggiorna la formulazione cinese in modo che la proprietà sia descritta come assente dal tipo PageState, quindi esegui nuovamente la riproduzione e conferma che il messaggio corretto preservi il significato inglese.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers, localization
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 75/100