microsoft / microsoft/TypeScript

[Localization] Misleading Chinese translation for TS2561 error message

Đang mở Phù hợp với người mới
#63,274 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bug Domain: Error Messages i18n
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách chạy ví dụ TypeScript được cung cấp với tsc --locale zh-CN và kiểm tra chẩn đoán TS2561 đã được bản địa hóa. Cập nhật cách diễn đạt bằng tiếng Trung để mô tả thuộc tính là không tồn tại trong kiểu PageState, sau đó chạy lại bản tái hiện và xác nhận rằng thông báo đã sửa vẫn giữ nguyên ý nghĩa tiếng Anh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
compilers, localization
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
75/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.