Skip to content

fix(loc): correct reversed subject/object in zh-CN translation of TS2561#63435

Open
creazyfrog wants to merge 1 commit intomicrosoft:mainfrom
creazyfrog:fix/zh-cn-ts2561-translation
Open

fix(loc): correct reversed subject/object in zh-CN translation of TS2561#63435
creazyfrog wants to merge 1 commit intomicrosoft:mainfrom
creazyfrog:fix/zh-cn-ts2561-translation

Conversation

@creazyfrog
Copy link
Copy Markdown

Summary

Fixes #63274

The Simplified Chinese (zh-CN) translation of error TS2561 had the subject and object reversed, causing Chinese-speaking developers to misread which property doesn't exist in which type.

The problem

Text
English Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?
Old Chinese (wrong) 对象字面量只能指定已知的属性,但"{0}"中不存在类型"{1}"。是否要写入 {2}?
New Chinese (fixed) 对象字面量只能指定已知属性,但"{0}"在类型"{1}"中不存在。您是否想写"{2}"?

The old text literally reads "but type '{1}' does not exist in '{0}'" — the complete opposite of the intended meaning. A developer reading this would think their type name is wrong, when actually the property name is wrong.

Changes

  1. Core fix: 但"{0}"中不存在类型"{1}"但"{0}"在类型"{1}"中不存在 (property does not exist in type, not type does not exist in property)
  2. Remove redundant : 已知的属性已知属性
  3. Improve suggestion phrasing: 是否要写入 {2}?您是否想写"{2}"? (add quotes around the suggestion, more natural Chinese)

File changed

src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl — 1 line changed

The Simplified Chinese translation of error TS2561 had the subject and
object swapped: it read "type '{1}' does not exist in '{0}'" instead of
"'{0}' does not exist in type '{1}'", inverting the logical relationship
and misleading Chinese-speaking developers.

Three corrections applied:
- Restructure "但"{0}"中不存在类型"{1}"" → "但"{0}"在类型"{1}"中不存在"
  (property does not exist in type, not type does not exist in property)
- Remove redundant 的: "已知的属性" → "已知属性"
- Improve closing phrase: "是否要写入 {2}?" → "您是否想写"{2}"?"
  (add quotes around the suggestion, use natural phrasing)

Fixes microsoft#63274

Signed-off-by: creazyfrog <rohitcse.gec@gmail.com>
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Apr 26, 2026
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

[Localization] Misleading Chinese translation for TS2561 error message

2 participants