Files
orca/config/scripts
07ea055d4e fix(i18n): interpolate the settings-search empty-state query instead of concatenating translated fragments (#19693)
* fix(i18n): interpolate the settings-search empty-state query

The empty state rendered three sibling JSX nodes: a translated prefix
`No settings found for "`, the raw query, then a translated closing `"`.
English reads correctly only because English puts the quoted term after
the verb. Korean and Chinese put it before, so translators given the
leading fragment in isolation localized it as a complete clause and the
query was concatenated after the sentence had already ended:

  ko: "에 대한 설정을 찾을 수 없습니다.screen reader"
  zh: 找不到“的设置screen reader”

No value for the prefix key can fix this. A fixed prefix/suffix split
hard-codes one word order into the code, and the position where a
language needs the interpolated value is exactly what differs between
languages — so any single split is wrong for some locale by
construction. The message has to be one string with a placeholder, which
moves the decision of where the query goes from the JSX into each
locale's catalog entry.

Replace the fragments with one `{{value0}}` message under a new key.
The old keys are retired rather than reused: their translations are
clause fragments and would be wrong under the new shape. Korean and
Chinese get the natural order; es/fr/ja reassemble their own existing
fragments around the placeholder. ko/zh are also pinned in the
cross-locale key overrides next to the existing precedent for this same
fragment-concatenation class, so a catalog regeneration cannot
reintroduce the clause form.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(i18n): drop assertions the expected-message table already makes

Three of the file's assertions restated what the per-locale exact-match
table proves on its own, and one setup step was dead:

- "carries the query placeholder in every locale" — an exact match on the
  rendered sentence cannot pass if a catalog value lost `{{value0}}`,
  since the query would be missing from the output. Its `undefined` skip
  branch was also unreachable: the catalogs it iterates are the same six
  the table covers.
- "closes the ko/zh clause after the query" — `toBe` on the full string
  already fixes where the clause sits relative to the query.
- `beforeEach(changeLanguage('en'))` — the remaining table test sets its
  own language per case, and the catalog test reads the JSON directly and
  never consults i18n.

Verified by mutation rather than assumed. Each of these makes the
trimmed file fail, so nothing the deleted assertions guarded is now
unguarded:

  ko value loses {{value0}}              1 failed / 6 passed
  es value loses {{value0}}              1 failed / 6 passed
  ko puts the clause before the query    1 failed / 6 passed
  zh ends with the query                 1 failed / 6 passed
  a retired fragment key returns in ja   1 failed / 6 passed

Clean: 7 passed. With the rest of the change reverted to main and this
file kept: 6 failed / 1 passed. The docblock keeps the reason the shape
changed and loses the retelling of it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-10-27 17:34:46 -07:00
..