microsoft / microsoft/TypeScript
[Localization] Misleading Chinese translation for TS2561 error message
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
### 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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza ejecutando el ejemplo de TypeScript proporcionado con tsc --locale zh-CN e inspecciona el diagnóstico TS2561 localizado. Actualiza la redacción en chino para describir la propiedad como ausente del tipo PageState; después, vuelve a ejecutar la reproducción y confirma que el mensaje corregido conserva el significado en inglés.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers, localization
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 75/100