Skip to content

fix(adopt): keep the Unix messages lite already translates - #141

Merged
fylorn merged 1 commit into
mainfrom
fix/adopt-message-contract
Sep 23, 2026
Merged

fylorn merged 1 commit into
mainfrom
fix/adopt-message-contract

Conversation

@fylorn

@fylorn fylorn commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #138, which changed a message contract without meaning to.

lite translates core messages by code, using the arguments the released version sends. #138 changed three Unix messages:

  • adopt.diag.shell_export lost its line argument (lite's Chinese uses it, so it would render "line undefined").
  • its English became "{name} is already set in {path}".
  • adopt.diag.no_exports.detail gained a looked argument, and on Windows lite's Chinese would still say it checked .zshrc.

This restores the Unix messages exactly as in v0.30.0 (checked by diffing every adopt.diag.* code, argument list and English text against the tag). Windows says different sentences, so it gets its own codes rather than sharing one:

code args English
adopt.diag.registry_env name, key {name} is set in the registry under {key}
adopt.diag.registry_env.overrides client {client} reads the environment, so this variable overrides what was written here.
adopt.diag.no_registry_env – No environment variable of the same name is set
adopt.diag.no_registry_env.detail – Checked the user and the machine environment variables.

plus adopt.diag.unset_env / adopt.diag.unset_env_machine from #138. lite will add translations for these six when it moves to the next core tag.

EnvConflict now carries the finding's title, fix, and the "overrides" detail, built by each platform branch; diagnose just assembles them.

Verification

cargo fmt --check, cargo clippy --all-targets -D warnings, cargo clippy -p tw-adopt --lib -D warnings, cargo test --workspace pass on macOS. Windows is covered by this repo's Windows CI job.

🤖 Generated with Claude Code

#138 folded the Unix and Windows findings about same-name variables into
one message: `adopt.diag.shell_export` lost its `line` argument and got a
new English sentence, and `no_exports.detail` gained a `looked`
argument. lite translates by code with the arguments of the released
version, so its Chinese would have read "line undefined" and claimed
.zshrc was checked on Windows.

The Unix messages are back exactly as in v0.30.0. Windows says different
sentences, so it gets its own codes instead of sharing one:
adopt.diag.registry_env, adopt.diag.registry_env.overrides,
adopt.diag.no_registry_env and adopt.diag.no_registry_env.detail. Each
platform branch now builds its whole sentences; the shared finding code
only assembles them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn force-pushed the fix/adopt-message-contract branch from 6fca58b to b3b3f02 Compare September 23, 2026 12:56
@fylorn
fylorn merged commit 21323db into main Sep 23, 2026
2 checks passed
@fylorn
fylorn deleted the fix/adopt-message-contract branch September 23, 2026 13:07
@fylorn fylorn mentioned this pull request Sep 23, 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