Conversation
- Add i18n module using Svelte stores for reactive locale state - Create translation files for English (en) and Japanese (ja) - Add LanguageSwitcher component in header - Persist user's language preference to localStorage - Auto-detect browser language on first visit - Update all UI text in App.svelte, ContextOptions, ScoreResult, and DoraPicker - Fix a11y warnings (labels without controls, dialog tabindex) The localization covers: - Header/footer text - Hand builder section (melds, tiles, hints) - Scoring options (win type, winds, riichi, situational yaku) - Results display (han, fu, yaku, dora, fu breakdown) - All buttons and labels Type-safe translations with TypeScript interfaces ensure maintainability when adding new languages.
- Add translations for all yaku names (riichi, tanyao, pinfu, etc.) - Add translations for score levels (mangan, haneman, baiman, etc.) - Create translateYaku() and translateScoreLevel() helper functions - Update ScoreResult component to use translated values The yaku names now display in Japanese when Japanese locale is selected: - 立直, 一発, 断幺九, 平和, etc. Score levels also display in Japanese: - 満貫, 跳満, 倍満, 三倍満, 役満, etc.
- Update yakuNameMap keys to match agari-wasm yaku_name() output - WASM uses shorter names (e.g., 'Sanshoku Doujun') vs CLI's verbose names (e.g., 'Sanshoku Doujun (Mixed Triple Sequence)') - Fix Yakuhai format: 'Yakuhai (East)' instead of 'Yakuhai: East Wind' - Make translateYaku/translateScoreLevel reactive by passing $t param - Export yakuNameMap and scoreLevelMap for component use
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.
Summary
Adds Japanese (日本語) localization support to the Agari WebUI with automatic browser language detection and persistent user preference.
Changes
New i18n System
web/src/lib/i18n/types.ts)web/src/lib/i18n/en.ts)web/src/lib/i18n/ja.ts)web/src/lib/i18n/index.ts)UI Updates
LanguageSwitchercomponent in headerApp.svelte,ContextOptions.svelte,ScoreResult.svelte,DoraPicker.svelteAccessibility Fixes
Testing
svelte-check: 0 errors, 0 warnings