Skip to content

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

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

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

@creazyfrog creazyfrog commented Apr 26, 2026

What this change intends to do

Fixes #63274

Corrects the Simplified Chinese (zh-CN) translation of error TS2561, where the subject and object were swapped, causing the error message to read as the opposite of its intended meaning.

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 zh-CN (wrong) 对象字面量只能指定已知的属性,但"{0}"中不存在类型"{1}"。是否要写入 {2}?
New zh-CN (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 Chinese-speaking developer reading this would think their type name is wrong, when actually their property name is wrong.

Changes in the fixed translation

  1. Core fix: 但"{0}"中不存在类型"{1}"但"{0}"在类型"{1}"中不存在 (property {0} does not exist in type {1}, not the other way around)
  2. Remove redundant : 已知的属性已知属性 (more natural Chinese)
  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

Tests

This PR changes only a localization resource file (.lcl). There are no TypeScript compiler tests for translation strings, so no test baselines are affected. The fix can be verified by running tsc --locale zh-CN on a file that triggers TS2561 and confirming the error message now correctly reads that the property does not exist in the type.

AI Assistance Disclosure

This PR was developed with the assistance of Claude Code (Anthropic), as required to be disclosed per the CONTRIBUTING.md guidelines.

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 <[email protected]>
@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
@RyanCavanaugh
Copy link
Copy Markdown
Member

Unfortunately we're not able to take localization fixes externally - these files are sourced from our translation team and they don't have an upstream merging process

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Apr 27, 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: Done

Development

Successfully merging this pull request may close these issues.

[Localization] Misleading Chinese translation for TS2561 error message

3 participants