英語モードでWFCD由来の名前を英語のまま表示する - #10
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9
変更
item-i18n.ts/quest-i18n.ts/location-i18n.tsの3辞書は Core Mandate 3 で「ロケールに関係なく常時日本語名を出す(今回のスコープ外、意図的)」とされていたが、そのせいで英語モードが英語の枠の中に日本語のゲームデータが並ぶ状態になっていた。パーツ名・素材名・クエスト名・入手先は Warframe プレイヤーが実際に読む中核情報なので、切替が最後まで通っていなかったことになる。3辞書とも EN -> JA の一方向で、入力は既に英語で保存されている名前。よって英語モードでは恒等関数にするだけでよく、新規翻訳はゼロ。同じガードは既に3箇所(
standing.tsのitemJa()、stats.tsのplanetJa()、quest-onboarding.ts)で使われている形をそのまま踏襲した。questEn()はガード不要と判断(英語名はQUEST_ENにヒットせず素通し、手入力の日本語名は従来どおり解決する)。nodeDisplayName()/locationJa()は上記の合成なので自動的に追従する。副次的に、
stats.tsとbuild-sidebar.tsのソートロケールが"ja"固定だったのをeffective()連動にした(並べる名前が英語になりうるため)。検証
tsc --noEmitクリーン、bun test104 pass / 0 fail。さらにローカル(
bun run dev→ 8788)で Chain View に3経路すべてを踏むノードを投入して実機確認した(確認後に削除済み):ChassisitemJa()完全一致Volt Prime BlueprintitemJa()サフィックスマッチThe Second DreamquestJa()graph-state.tsのonLocaleChange再描画で足りていた)追加分(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.tsはlocale.tsを import すらしておらず、日本語がハードコードされていた。これらはTS移行(2026-08-26〜29)で実配線されたもので、08-30 のi18n一括対応が対象を列挙した後に入ったため、そのスコープに最初から入っていない。対応したのは約195文字列:
booster.ts3日5時間/3d 5h)scratch.tswallpaper.tsmanual.ts+manual.htmltheme.ts/scroll-top.ts/kofi-link.ts/manual-launcher.tsglossary.ts+glossary.htmlマニュアルだけ構造が違う。
title/body/sectionをRecord<Locale, string>にして、各トピックが2言語を隣に持つ形にした。JA配列とEN配列を並べる案は、トピックを片方にだけ足したときに静かにズレるので採らなかった(隣接フィールドなら型エラーになる)。ブースター名は wiki の英語名(Affinity / Credit / Resource / Resource Drop Chance / Mod Drop Chance)をそのまま使っている。用語マッピングタブの日本語列はデータであってchromeではないので、英語モードでも日本語のまま出るのが正しい。
追加分の検証
tsc --noEmitクリーン、bun test104 pass / 0 fail。ローカル(8788)で確認したもの:Timers/Quick Memo、種別プルダウンがFrame/Weapon/Quest日本語という選択肢自体と、用語マッピングのデータ側のっちの実機UXチェック済み(2026-09-07)。
未了
実機UXチェックは 2026-09-07 に完了。ただし以下は今回の自動確認では踏めていない:
locationJa())— 実際にWFCDから取得する経路なので未検証node-modal.ts/wfcd-wizard.tsのオートコンプリート(英語モードではquestJa(n) !== nが常に false になり、日本語(English)形式のラベルが英語名のみになる。意図どおりのはずだが実際の使用感は要確認)マージ後にやること
SKILL.mdCore Mandate 3 の記述を更新する。2点ある:item-i18n/quest-i18n/location-i18nの「ロケールに関係なく常時日本語名を出す(今回のスコープ外、意図的)」は、このPRで解消済み補足(このPRには含めない別件)
.gitignoreにdistの記載がなく、ts/dist/data/edge-app-profile/にEdgeのプロファイル一式(Edge Wallet の拡張データ含む)が置かれている。現状は未追跡なので流出していないが、git add .を一度打つと公開リポジトリに入る。別Issueにするか、ここでまとめて直すか指示がほしい。🤖 Generated with Claude Code
https://claude.ai/code/session_016cUfRtr2AzKzYrwemReNou