Skip to content

feat(i18n): move home screen texts into a dictionary with en and zh - #180

Merged
AliceSaikawa merged 3 commits into
mainfrom
feat/issue-78-i18n-home
Oct 22, 2026
Merged

AliceSaikawa merged 3 commits into
mainfrom
feat/issue-78-i18n-home

Conversation

@AliceSaikawa

@AliceSaikawa AliceSaikawa commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

Part of the English and Simplified Chinese rollout (Issue #78). The session list, workspace drawer and folder picker wrote Japanese inline and formatted dates by hand (yyyy/mm/dd, HH:mm). This moves them into homeMessages with ja, en and zh and formats dates with formatDateTime. Until the last PR enables the languages, the page stays Japanese.

Scope

  • New web/src/features/home/messages.ts (homeMessages, 98 keys).
  • HomeScreen.tsx, SessionRow.tsx, WorkspaceDrawer.tsx, DirectoryScreen.tsx, actions.tsx use useMessages(homeMessages).
  • data.ts: formatUpdatedAt(timestamp, now, locale, text) uses formatDateTime; folderName(path, text).
  • directory.ts (nativeUnavailableMessage is now a function), session-navigation.ts (errors take the texts).
  • Terms: docs/i18n/terms/home.md; the main terms are also rows in docs/i18n/glossary.md.

Tradeoffs

  • Captions with counts are whole-sentence functions, so English can say “1 session” and “2 sessions”.
  • The separator ・ between row details is its own key (rowSeparator), like the inbox, because the workspace name sits in a <small> and cannot join one sentence.

Blast radius

No visible change: Japanese strings and the formatUpdatedAt results are identical (tests/11-i18n.test.ts already proves the formatDateTime options give 2026/01/05 and 09:07), and tests/01-*.test.ts pass unchanged.

Verification

  • pnpm typecheck, pnpm test (1,460 tests, 1,458 pass, 2 existing skips), pnpm build, git diff --check pass.
  • tests/01-i18n-home.test.ts checks dates, captions and errors in English and Chinese.
  • With every i18n PR merged and English and Chinese enabled, the home e2e (home-*, directory-*, session-menu-overflow) passes in ja-JP.

Refs #78

… and Chinese

The session list, its menus and dialogs, the workspace drawer and the folder picker now read their texts from web/src/features/home/messages.ts, with English and Simplified Chinese next to the Japanese. The list dates go through formatDateTime, so they follow the page language.

Copy link
Copy Markdown
Owner Author

独立レビュー(自動)の結果です。

判定:直してからマージ

指摘(優先度順)

  1. PR タイトルが 81 字:AGENTS.md の上限 72 字を超えていて、.github/workflows/pr-title.yml で CI が落ちています。
    • 短縮案:feat(i18n): move home screen texts into a dictionary with en and zh(67 字)
  2. 閉じるボタンの英語 Exit selection が並べ替え中にも出る(web/src/features/home/messages.ts:137、使用箇所 HomeScreen.tsx:135)
    • このボタンは通常モード以外(選択・並べ替えなど)すべてで changeMode('normal') に使われます。日本語「操作を終了」(L23) に合わせ、英語は Done や Exit、Close など選択に限らない語にしてください。中国語 退出操作 (L249) は可。
  3. フォルダ表示の上限(1,000 件)が英語・中国語から抜けている(messages.ts:226 英語、:338 中国語)
    • 日本語は「1,000 件を超えるフォルダは一部だけ表示します」(L112) です。英語 Only some of the folders are shown、中国語 仅显示一部分文件夹 は上限の数を落としています。英語は Over 1,000 folders: only some are shown など、中国語は 文件夹超过 1,000 个时仅显示一部分 のように数を入れてください(数の書式は formatNumber で locale に合わせるのが望ましい)。
  4. glossary 未更新
    • docs/design/11-i18n.md:118 の規則(訳を足す PR では docs/i18n/glossary.md に新しい用語を足す)に反しています。用語は docs/i18n/terms/home.md にだけ書かれています。
    • 新しい用語を docs/i18n/glossary.md の表に行として追記してください(terms ファイルを残すなら glossary.md からリンク)。

確認済み

  • typecheck・test(失敗 0)は通っています。

@AliceSaikawa AliceSaikawa changed the title feat(i18n): move the home screen texts into a dictionary with English and Chinese feat(i18n): move home screen texts into a dictionary with en and zh Oct 22, 2026
The English close button reads "Done", because it leaves reordering as well as selection. The English and Chinese folder limit note keeps the 1,000 that the Japanese states, as docs/i18n/terms/home.md already lists.
docs/design/11-i18n.md asks each translation PR to add its new terms to docs/i18n/glossary.md. The rows link to docs/i18n/terms/home.md for the rest.
@AliceSaikawa
AliceSaikawa merged commit 45d82ca into main Oct 22, 2026
7 checks passed
@AliceSaikawa
AliceSaikawa deleted the feat/issue-78-i18n-home branch October 22, 2026 12:54
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