Skip to content

feat: the crates speak English - #56

Merged
fylorn merged 1 commit into
mainfrom
i18n/rest
Sep 20, 2026
Merged

fylorn merged 1 commit into
mainfrom
i18n/rest

Conversation

@fylorn

@fylorn fylorn commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

crates/ no longer contains a Chinese string literal outside tests. This
finishes what the gateway (#54)
and the control plane (#55)
started: every thiserror message, every diagnostic sentence, every label()
and why(), every tracing line and every expect.

The pieces worth naming

tw-adopt writes into the user's own configuration files, and what it
writes is English now: the sentinel comment block, the sidecar record's field
names (what_this_file_is, how_to_restore_by_hand, full_backup) and every
takeover note and diagnostic.

A client adopted by an earlier version cannot be restored by this one. Its
markers and its record use the old names. This was a deliberate call rather
than carrying both spellings.

tw-engine: the synthesized default route is default and its catch-all
rule is catch-all, not 默认 and 兜底. Those names reach RequestRouted.rule
and a saved configuration.

tw-scan: the reason each kind of file is dangerous — the sentence the
Findings page prints under every finding.

tw-config: validation, credentials, YAML editing, the version history and
the disk states.

tw-dialect: the rejections that go back to a client when a request cannot
be converted — previous_response_id, cachedContent, compaction and the
rest.

Tests

Tests that asserted on Chinese product strings assert on the English. Fixtures
that happened to name a route 默认 now name it default, because that is the
name the engine synthesizes. Chinese in test data that is only test data stays
as it is — it is there to prove the code handles it.

Still Chinese

bin/twcore, the CLI's own output: about 70 strings. Nothing in crates/.

Verified

cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace (78 suites, 0 failures) and
./scripts/smoke.sh (51 passed, 0 failed).

🤖 Generated with Claude Code

`crates/` no longer contains a Chinese string literal outside tests.
This finishes what the gateway and the control plane started: every
`thiserror` message, every diagnostic sentence, every `label()` and
`why()`, every `tracing` line and every `expect` is English.

The pieces worth naming:

- **`tw-adopt`** writes into the user's own configuration files, and
  what it writes is now English: the sentinel comment block, the sidecar
  record's field names (`what_this_file_is`, `how_to_restore_by_hand`,
  `full_backup`) and every takeover note and diagnostic. A client
  adopted by an earlier version cannot be restored by this one — its
  markers and record use the old names.
- **`tw-engine`**: the synthesized default route is `default` and its
  catch-all rule is `catch-all`, not 默认 and 兜底. These names appear in
  `RequestRouted.rule` and in a saved configuration.
- **`tw-scan`**: the reason each kind of file is dangerous, which is the
  sentence the Findings page shows under every finding.
- **`tw-config`**: validation, credentials, YAML editing, the version
  history and the disk states.
- **`tw-dialect`**: the rejections that go back to a client when a
  request cannot be converted — `previous_response_id`, `cachedContent`,
  `compaction` and the rest.

Tests that asserted on Chinese product strings assert on the English.
Fixtures that happened to name a route 默认 now name it `default`,
because that is the name the engine synthesizes; the Chinese in test
data that is only test data stays as it is.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit e82c972 into main Sep 20, 2026
1 check passed
@fylorn
fylorn deleted the i18n/rest branch September 20, 2026 07:06
@fylorn fylorn mentioned this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant