Skip to content

fix: localize hardcoded Chinese UI strings and commit tags on Tab - #11

Open
cleinias wants to merge 3 commits into
lenML:mainfrom
cleinias:fix/tagpicker-i18n-placeholder-and-tab-commit
Open

fix: localize hardcoded Chinese UI strings and commit tags on Tab#11
cleinias wants to merge 3 commits into
lenML:mainfrom
cleinias:fix/tagpicker-i18n-placeholder-and-tab-commit

Conversation

@cleinias

@cleinias cleinias commented Sep 3, 2026

Copy link
Copy Markdown

Fixes several spots where UI strings were hardcoded in Chinese (shown regardless of the selected language), plus a related tag-input papercut.

Changes

1. TagPicker (lorebook keys / tags)

  • The FreeTagPicker default placeholder was a hardcoded "请输入标签", so it showed Chinese in every locale. It now uses t("Input or select tags") — a key already present in all four locale files, just never wired up.
  • A typed tag was only committed on Enter/comma, so pressing Tab to move to the next field silently discarded it. It now commits on Tab as well as Enter (extracted into commitQuery); Tab still advances focus afterwards. (Chose Tab rather than a general on-blur to avoid racing with dropdown option selection.)

2. Tool tab

  • Tool descriptions were rendered raw (<span>{desc}</span>) while the tool name already went through t(). Descriptions now go through i18n too, and WelcomeBuilder's hardcoded Chinese description becomes an English i18n key.

3. FullscreenEditor

  • The markdown persona-template completion (label, documentation, and the ${…} snippet placeholders such as 世界观 / 角色名 / 角色职业) was hardcoded Chinese. All routed through i18n now. (The single remaining Chinese in that file is a code comment, left untouched.)

Notes

  • New i18n keys are added to en and zh; ja/ko gracefully fall back to English until translated.
  • tsc -b passes.
  • Unrelated aside: npm run lint currently fails for everyone because the flat ESLint config references a non-existent no-unused-variable rule — happy to file that separately if useful.

cleinias and others added 3 commits September 3, 2026 12:51
FreeTagPicker had two papercuts in the lorebook/keys editor:

1. Its default placeholder was a hardcoded Chinese literal ("请输入标签"),
   so it showed Chinese regardless of the selected UI language. Route it
   through i18n instead; the "Input or select tags" key already exists in
   all four locale files (en/zh/ja/ko), it was simply never wired up.

2. A typed tag was only committed on Enter/comma — there was no Tab or
   blur handling, so pressing Tab to move to the next field silently
   discarded the pending key. Commit the pending tag on Tab as well as
   Enter (extracted into commitQuery); Tab still moves focus afterwards.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The tool description under each entry in the Tool tab was rendered raw
(`<span>{desc}</span>`) instead of through i18n, and WelcomeBuilder's
description was a hardcoded Chinese literal — so it showed Chinese in
every UI language. Pass the description through `t()` like the tool name
already is, make WelcomeBuilder's description an English i18n key, and add
that key to the en/zh locale files (ja/ko fall back to English until
translated).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eholders

The markdown persona-template completion (label, documentation, and the
${...} snippet placeholders such as 世界观 / 角色名 / 角色职业) was hardcoded
in Chinese, so it appeared Chinese in every UI language. Route them all
through i18n and add the keys to en/zh (ja/ko fall back to English). The
lone remaining Chinese in this file is a code comment, left untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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