microsoft / microsoft/TypeScript
[Localization] Misleading Chinese translation for TS2561 error message
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
### 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das bereitgestellte TypeScript-Beispiel mit tsc --locale zh-CN auszuführen, und untersuche die lokalisierte TS2561-Diagnose. Aktualisiere die chinesische Formulierung so, dass die Eigenschaft als im Typ PageState nicht vorhanden beschrieben wird. Führe anschließend die Reproduktion erneut aus und bestätige, dass die korrigierte Meldung die englische Bedeutung beibehält.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers, localization
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 75/100