Skip to content

英語モードでWFCD由来の名前を英語のまま表示する - #10

Merged
MotimotiNotch merged 2 commits into
mainfrom
fix/en-mode-game-data-names
Sep 7, 2026
Merged

MotimotiNotch merged 2 commits into
mainfrom
fix/en-mode-game-data-names

Conversation

@MotimotiNotch

@MotimotiNotch MotimotiNotch commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #9

2026-09-07 追記: のっちの実機チェックで別件が2つ見つかったので、このPRに追加した(下記「追加分」)。当初のスコープ(WFCD由来の名前)だけでは英語モードが実用にならなかったため。

変更

item-i18n.ts / quest-i18n.ts / location-i18n.ts の3辞書は Core Mandate 3 で「ロケールに関係なく常時日本語名を出す(今回のスコープ外、意図的)」とされていたが、そのせいで英語モードが英語の枠の中に日本語のゲームデータが並ぶ状態になっていた。パーツ名・素材名・クエスト名・入手先は Warframe プレイヤーが実際に読む中核情報なので、切替が最後まで通っていなかったことになる。

3辞書とも EN -> JA の一方向で、入力は既に英語で保存されている名前。よって英語モードでは恒等関数にするだけでよく、新規翻訳はゼロ。同じガードは既に3箇所(standing.tsitemJa()stats.tsplanetJa()quest-onboarding.ts)で使われている形をそのまま踏襲した。

questEn() はガード不要と判断(英語名は QUEST_EN にヒットせず素通し、手入力の日本語名は従来どおり解決する)。nodeDisplayName() / locationJa() は上記の合成なので自動的に追従する。

副次的に、stats.tsbuild-sidebar.ts のソートロケールが "ja" 固定だったのを effective() 連動にした(並べる名前が英語になりうるため)。

検証

tsc --noEmit クリーン、bun test 104 pass / 0 fail。

さらにローカル(bun run dev → 8788)で Chain View に3経路すべてを踏むノードを投入して実機確認した(確認後に削除済み):

ノード名 経路 日本語モード 英語モード
Chassis itemJa() 完全一致 シャーシ Chassis
Volt Prime Blueprint itemJa() サフィックスマッチ Volt Prime 設計図 Volt Prime Blueprint
The Second Dream questJa() 二番目の夢 The Second Dream
  • ヘッダーの切替だけでリロードなしに追従することを確認(既存の graph-state.tsonLocaleChange 再描画で足りていた)
  • 切替後、グラフSVG全体に日本語文字が1つも残っていないことを確認

追加分(2026-09-07)

のっちが英語モードを実機で見て、2つ報告された。

1. WFCDウィザードの種別プルダウンが日本語のまま

wfcd-wizard.ts:187 の種別プルダウンは、ラベルこそロケール対応の nodeTypeLabel() から取っているが、モジュール読み込み時に1回書くだけで onLocaleChange が無かった。そのため日本語で開いたあと英語に切り替えても フレーム/武器/クエスト のまま凍る。同ファイルの wfcd-note(Companion/Archwing/Necramech の注釈)も同型。

2026-08-30 の Collections インカーノン見出しと同じ種類のバグで、Core Mandate 3 に明記されている「JSが一度だけ書くテキストは onLocaleChange から書き直す」の踏み漏れ。プルダウンは innerHTML を入れ直すと選択が先頭に戻るので、選択値を保存・復元している。

2. ヘッダーのウィジェットとマニュアルがそもそも国際化されていなかった

こちらは書き直し漏れではなく未対応booster.ts / scratch.ts / wallpaper.ts / manual.tslocale.ts を import すらしておらず、日本語がハードコードされていた。これらはTS移行(2026-08-26〜29)で実配線されたもので、08-30 のi18n一括対応が対象を列挙した後に入ったため、そのスコープに最初から入っていない。

対応したのは約195文字列:

ファイル 内容
booster.ts タイマーのパネル・ヘルプ・ブースター名・期間・残り時間の表記3日5時間 / 3d 5h
scratch.ts クイックメモのパネル・記法チートシート・カウントアップ
wallpaper.ts 壁紙/アイコン設定モーダル、用語タブ、位置調整モーダル、confirm/alert の文言
manual.ts + manual.html マニュアル全32トピック(本文・見出し・目次・セクション名・ページタイトル)
theme.ts / scroll-top.ts / kofi-link.ts / manual-launcher.ts ボタンの title
glossary.ts + glossary.html デバッグ用ページの見出し

マニュアルだけ構造が違う。 title / body / sectionRecord<Locale, string> にして、各トピックが2言語を隣に持つ形にした。JA配列とEN配列を並べる案は、トピックを片方にだけ足したときに静かにズレるので採らなかった(隣接フィールドなら型エラーになる)。

ブースター名は wiki の英語名(Affinity / Credit / Resource / Resource Drop Chance / Mod Drop Chance)をそのまま使っている。用語マッピングタブの日本語列はデータであってchromeではないので、英語モードでも日本語のまま出るのが正しい。

追加分の検証

tsc --noEmit クリーン、bun test 104 pass / 0 fail。ローカル(8788)で確認したもの:

  • 英語で読み込み → ヘッダーが Timers / Quick Memo、種別プルダウンが Frame/Weapon/Quest
  • 日本語⇄英語をライブで往復 → 両方向で追従(これが 1. のバグ)
  • タイマーパネル・クイックメモパネル・設定モーダル(表示/用語タブ)・マニュアル全32トピックに日本語が1文字も残らない
  • 残る日本語は2ヶ所のみで、どちらも正しい: 言語プルダウンの 日本語 という選択肢自体と、用語マッピングのデータ側

のっちの実機UXチェック済み(2026-09-07)。

未了

実機UXチェックは 2026-09-07 に完了。ただし以下は今回の自動確認では踏めていない:

  • WFCDウィザードのプレビューに出る入手先locationJa())— 実際にWFCDから取得する経路なので未検証
  • node-modal.ts / wfcd-wizard.ts のオートコンプリート(英語モードでは questJa(n) !== n が常に false になり、日本語(English) 形式のラベルが英語名のみになる。意図どおりのはずだが実際の使用感は要確認)

マージ後にやること

SKILL.md Core Mandate 3 の記述を更新する。2点ある:

  1. item-i18n / quest-i18n / location-i18n の「ロケールに関係なく常時日本語名を出す(今回のスコープ外、意図的)」は、このPRで解消済み
  2. 「JA/EN切替は全ページ対応済み(2026-08-30)」は、今日までこの範囲について事実ではなかった。翻訳済みモジュールの列挙に今回の8ファイルを足す

補足(このPRには含めない別件)

.gitignoredist の記載がなく、ts/dist/data/edge-app-profile/ にEdgeのプロファイル一式(Edge Wallet の拡張データ含む)が置かれている。現状は未追跡なので流出していないが、git add . を一度打つと公開リポジトリに入る。別Issueにするか、ここでまとめて直すか指示がほしい。

🤖 Generated with Claude Code

https://claude.ai/code/session_016cUfRtr2AzKzYrwemReNou

MotimotiNotch and others added 2 commits September 7, 2026 15:52
item-i18n/quest-i18n/location-i18n were deliberately locale-independent
(always Japanese), so English mode rendered English chrome around Japanese
game data — part/material names, quest names, and drop locations. That is
the part a Warframe player actually reads, so the toggle was not usable
end to end.

All three are EN->JA one-way lookups over names that are already stored in
English, so the fix is the identity guard the sibling dictionaries
(standing.ts's itemJa, stats.ts's planetJa, quest-onboarding.ts) already
use. No new translations. questEn() needs no guard: an English name misses
QUEST_EN and passes through, and a hand-typed Japanese name still resolves.

Also unpins the sort locale in stats.ts and build-sidebar.ts, which was
fixed to "ja" while the names being sorted can now be English.

Verified in the browser against Chain View nodes covering all three lookup
paths (exact match, suffix match, quest): names switch with no reload — the
existing onLocaleChange re-render already reaches them — and no Japanese
remains anywhere in the graph SVG.

Closes #9

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016cUfRtr2AzKzYrwemReNou
… modal

English mode covered the pages' own chrome but not the widgets bolted onto
every page, so switching to English still left タイマー / クイックメモ in the
header, a Japanese-only manual, and a Japanese settings modal. Those modules
(booster/scratch/wallpaper/manual, plus the four icon-button widgets) were
wired up during the TS migration on 2026-08-26..29, after the 08-30 i18n pass
had already enumerated what to convert, so they were never in its scope and
never imported locale.ts at all.

Also fixes the write-once bug that surfaced this: wfcd-wizard's node-type
dropdown built its labels from the locale-aware nodeTypeLabel() at module
load and had no onLocaleChange, so it froze at whatever language was active
then and kept showing フレーム/武器/クエスト after a switch to English. Same
class of bug as the Collections incarnon heading (2026-08-30) — text a module
writes exactly once can't carry a data-i18n attribute, so it has to be
re-applied from onLocaleChange.

The manual keeps both languages on each topic (title/body/section are
Record<Locale, string>) rather than holding two parallel topic arrays: a
topic added to one array only would drift silently, whereas adjacent fields
fail to compile.

Booster names use the wiki's own English (Affinity/Credit/Resource/Resource
Drop Chance/Mod Drop Chance) and the remaining-time format switches with the
locale (3日5時間 / 3d 5h). The glossary tab's Japanese column is data, not
chrome, so it stays Japanese in both languages by design.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012quUSXLZjsrRhTRQuiKKaZ
@MotimotiNotch
MotimotiNotch merged commit a5cf369 into main Sep 7, 2026
1 check passed
@MotimotiNotch
MotimotiNotch deleted the fix/en-mode-game-data-names branch September 7, 2026 12:48
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