Skip to content

feat: i18n localization — full CJK translations + data consumer wiring#302

Merged
mokn merged 14 commits intodevfrom
feat/i18n-localization
Mar 26, 2026
Merged

feat: i18n localization — full CJK translations + data consumer wiring#302
mokn merged 14 commits intodevfrom
feat/i18n-localization

Conversation

@mokn
Copy link
Copy Markdown
Collaborator

@mokn mokn commented Mar 26, 2026

Summary

  • Complete i18n system with i18next, browser language detection, and language switcher
  • All 60+ components wired to 7 translation namespaces (ui, items, classes, monsters, effects, narrative, pages)
  • Full CJK translations (KO/JA/ZH) for 500+ keys with register-appropriate formality
  • Data consumers (items, classes, fragments, effects, level narratives, rest flavor, monster moves) read from i18n namespaces instead of hardcoded TypeScript
  • CJK font support (Noto Sans KR/JP/SC) with glossary for translation consistency

Test plan

  • Build passes (pnpm build client)
  • Switch language via LanguageSwitcher in all 4 languages
  • Verify all pages render correctly (FAQ, Manifesto, Landing, Welcome, ClassPage)
  • Verify battle log shows translated monster move names
  • Verify level-up narratives display in selected language
  • Verify rest flavor text shows translated toast
  • Check for text overflow in CJK (especially Japanese which tends to be longer)

🤖 Generated with Claude Code

mokn and others added 14 commits March 26, 2026 13:40
Set up i18next with browser language detection, 7 namespaces (ui, items,
classes, monsters, effects, narrative, pages), and 4 languages (en, ko,
ja, zh). Added CJK font support (Noto Sans KR/JP/SC), LanguageSwitcher
component in Header, glossary with proper nouns and tone guidance, and
full translations of items, classes, effects, and narrative content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract hardcoded English strings from BetaBanner, BadgeDisplay, Level,
DiscordButton, FeedbackButton, CaptchaGate, SoundToggle, MapPanel,
SignInModal, ConnectWalletModal, OutOfResourcesModal, LevelUpModal,
LevelUpBanner, EditCharacterModal, ShopAllowanceModal,
MarketplaceAllowanceModal, LootManagerAllowanceModal,
BattleOutcomeModal, ItemEquipModal, and FragmentClaimModal. All strings
now use useTranslation('ui') with t() calls and interpolation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, ShareButton, HealthBar, DurabilityBar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nel, GoldMerchantModal, NpcDialogueModal, ItemConsumeModal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nel, RepairShopPanel, ItemCard, MiniLeaderboard

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, DelegationButton, ConsumableQuickUse, GameEventFeed, ShopHalf, ShopItemRow, MarketplaceRow, OrderRow, CreateListingModal, FragmentCollection, FragmentReadModal, FragmentChainProgress, LootReveal, LeaderboardRow, MapRevealOverlay, AdvancedClassModal

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sitionOverlay

Combat messages, tile details, zone transition narrative text,
and remaining UI labels extracted to i18n.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
FAQ (10 Q&As + meta), Manifesto, LandingPage, Welcome, ClassPage
now use useTranslation('pages') + t() calls. Shared intro narrative
keys (intro.p1-p4) reused across Landing and Welcome.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Full CJK translations for all 426 UI keys and 73 page content keys.
Follows glossary tone/register guidelines per language.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- itemDescriptions: helpers.ts uses i18n.t() from items namespace
- classData: ClassPage reads text from classes namespace, keeps
  structural data (slug/color/image/multipliers) from classData.ts
- fragmentNarratives: FragmentContext reads from narrative namespace
- effects: ActionsPanel reads names/descriptions from effects namespace

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Weapon buttons were all forced into a single row on desktop (flexWrap: nowrap),
causing names to clip and stat badges to overlap. Now uses a consistent 2x2 grid
with two-line button content (name + metadata) for breathing room.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When mobs initiate combat (attackers_are_mobs=true), the player wallet
is in the defenders field, not attackers. This caused ~37% of loot events
to show "An adventurer" instead of the actual player name.

Also fixes backfill events to resolve both player and item names instead
of hardcoding "An adventurer found an item!".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ations

- LEVEL_NARRATIVES → narrative.json `levelUp.*` keys, wire LevelUpModal
- REST_FLAVOR → narrative.json `restFlavor` array, wire TileDetailsPanel
- MONSTER_MOVE_MAPPING → monsters.json `moves.*` keys, wire ActionsPanel
- All new keys translated to KO/JA/ZH (10 levelUp + 5 restFlavor + 11 moves)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Mar 26, 2026 9:48pm
ud Error Error Mar 26, 2026 9:48pm
ud-api Error Error Mar 26, 2026 9:48pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ud-api-beta Ignored Ignored Mar 26, 2026 9:48pm

Request Review

@mokn mokn merged commit 4eb2c57 into dev Mar 26, 2026
5 of 11 checks passed
@mokn mokn deleted the feat/i18n-localization branch March 26, 2026 22:31
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