diff --git a/web/src/App.svelte b/web/src/App.svelte index ffaee33..2e086dc 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -9,11 +9,13 @@ type ShantenResponse, ALL_TILES, } from './lib/agari'; + import { t } from './lib/i18n'; import TilePalette from './lib/components/TilePalette.svelte'; import ContextOptions from './lib/components/ContextOptions.svelte'; import ScoreResult from './lib/components/ScoreResult.svelte'; import Tile from './lib/components/Tile.svelte'; import DoraPicker from './lib/components/DoraPicker.svelte'; + import LanguageSwitcher from './lib/components/LanguageSwitcher.svelte'; // ============================================================================ // State @@ -623,19 +625,20 @@ 🀄 Agari -

Riichi Mahjong Calculator

+

{$t.tagline}

+
{#if wasmError}
- ⚠️ Failed to load calculator: {wasmError} + ⚠️ {$t.failedToLoad} {wasmError}
{:else if !wasmLoaded}
- Loading calculator... + {$t.loadingCalculator}
{:else}
@@ -643,9 +646,9 @@
-

Build Your Hand

+

{$t.buildYourHand}

@@ -659,25 +662,25 @@
- Add Meld: - - - - + {$t.addMeld} + + + +
{#if showMeldBuilder}
- Building {meldBuilderType === 'ankan' ? 'Closed Kan' : meldBuilderType === 'kan' ? 'Open Kan' : meldBuilderType.charAt(0).toUpperCase() + meldBuilderType.slice(1)} + {#if meldBuilderType === 'chi'}{$t.buildingChi}{:else if meldBuilderType === 'pon'}{$t.buildingPon}{:else if meldBuilderType === 'kan'}{$t.buildingOpenKan}{:else}{$t.buildingClosedKan}{/if} {#if meldBuilderType === 'chi'} - (select 3 sequential tiles of the same suit) + {$t.hintChi} {:else if meldBuilderType === 'pon'} - (select 3 of the same tile) + {$t.hintPon} {:else} - (select 4 of the same tile) + {$t.hintKan} {/if}
@@ -695,13 +698,13 @@ {/each}
- +
@@ -712,7 +715,7 @@ {#if melds.length > 0}
-

Called Melds

+

{$t.calledMelds}

{#each melds as meld, index (meld.id)}
@@ -735,9 +738,9 @@
-

Your Hand

+

{$t.yourHand}

{#if handTiles.length > 0} - Click a tile to select it as winning tile + {$t.selectWinningTileHint} {/if}
@@ -751,7 +754,7 @@ > {#if selectedWinningTileIndex === index} -
WIN
+
{$t.winBadge}
{/if}
@@ -797,14 +800,14 @@ class="dora-toggle" onclick={() => showDoraSection = !showDoraSection} > - Dora Indicators + {$t.doraIndicators} {#if showDoraSection}
- + {$t.dora}
{#each doraIndicators as entry, index (entry.id)}
@@ -826,14 +829,14 @@ type="button" class="dora-add-btn" onclick={() => showDoraPicker = true} - >+ Add + >{$t.addButton} {/if}
{#if isRiichi}
- + {$t.uraDora}
{#each uraDoraIndicators as entry, index (entry.id)}
@@ -855,7 +858,7 @@ type="button" class="dora-add-btn" onclick={() => showUraDoraPicker = true} - >+ Add + >{$t.addButton} {/if}
@@ -863,7 +866,7 @@ {#if akaCount > 0}
- Aka Dora in hand: {akaCount} + {$t.akadoraInHand} {akaCount}
{/if}
@@ -890,7 +893,7 @@
-

Results

+

{$t.results}

-

Options

+

{$t.options}

{#if isCalculating} - Calculating... + {$t.calculating} {:else} - Calculate Score + {$t.calculateScore} {/if}
@@ -940,8 +943,8 @@

- Powered by Agari - — A Riichi Mahjong scoring engine written in Rust + {$t.footerPoweredBy} Agari + {$t.footerDescription}

diff --git a/web/src/lib/components/ContextOptions.svelte b/web/src/lib/components/ContextOptions.svelte index 6453825..8a04635 100644 --- a/web/src/lib/components/ContextOptions.svelte +++ b/web/src/lib/components/ContextOptions.svelte @@ -1,5 +1,5 @@ + +
+ + +
+ + diff --git a/web/src/lib/components/ScoreResult.svelte b/web/src/lib/components/ScoreResult.svelte index 32e6689..f989318 100644 --- a/web/src/lib/components/ScoreResult.svelte +++ b/web/src/lib/components/ScoreResult.svelte @@ -1,5 +1,25 @@