feat(i18n): integrate internationalization for game pages
- Added translation support for various game-related texts in the home, daily, infinite, login, and profile pages. - Replaced hardcoded French strings with translation keys using the `$t` function. - Updated titles, descriptions, and button texts to enhance localization.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { formatBounty } from '$lib';
|
||||
import type { CharacterWithRelations } from '$lib/server/daily-character';
|
||||
import { t } from '$lib/i18n';
|
||||
|
||||
export let selectedCharacters: CharacterWithRelations[];
|
||||
export let dailyCharacter: CharacterWithRelations;
|
||||
@@ -68,10 +69,10 @@
|
||||
>
|
||||
<div class="flex flex-col gap-4">
|
||||
<div class="flex flex-col items-center gap-4 text-center">
|
||||
<p class="text-xs font-semibold tracking-[0.28em] text-amber-100 uppercase">Historique</p>
|
||||
<p class="text-xs font-semibold tracking-[0.28em] text-amber-100 uppercase">{$t.game.components.guessHistory.title}</p>
|
||||
</div>
|
||||
{#if selectedCharacters.length === 0}
|
||||
<p class="text-center text-sm text-slate-200">Aucune tentative pour le moment.</p>
|
||||
<p class="text-center text-sm text-slate-200">{$t.game.components.guessHistory.empty}</p>
|
||||
{:else}
|
||||
<div class="-mx-6 overflow-x-auto px-6 pb-2 sm:mx-0 sm:px-0">
|
||||
<div class="mx-auto w-max min-w-max">
|
||||
@@ -83,7 +84,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Personnage
|
||||
{$t.game.components.guessHistory.character}
|
||||
</p>
|
||||
</div>
|
||||
{#if columnVisibility.status !== false}
|
||||
@@ -93,7 +94,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Statut
|
||||
{$t.game.components.guessHistory.status}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -104,7 +105,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Genre
|
||||
{$t.game.components.guessHistory.gender}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -115,7 +116,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Affiliations
|
||||
{$t.game.components.guessHistory.affiliations}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -126,7 +127,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Fruit
|
||||
{$t.game.components.guessHistory.fruit}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -137,7 +138,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Haki
|
||||
{$t.game.components.guessHistory.haki}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -148,7 +149,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Prime
|
||||
{$t.game.components.guessHistory.bounty}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -159,7 +160,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Taille
|
||||
{$t.game.components.guessHistory.height}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -170,7 +171,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Origine
|
||||
{$t.game.components.guessHistory.origin}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -181,7 +182,7 @@
|
||||
<p
|
||||
class="text-[9px] font-semibold tracking-wider text-amber-100 uppercase sm:text-xs"
|
||||
>
|
||||
Arc
|
||||
{$t.game.components.guessHistory.arc}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -229,14 +230,14 @@
|
||||
>
|
||||
<p class="text-center text-[10px] font-bold text-white sm:text-xs md:text-sm">
|
||||
{character.status === 'Alive'
|
||||
? 'Vivant'
|
||||
? $t.game.components.guessHistory.alive
|
||||
: character.status === 'Dead'
|
||||
? 'Mort'
|
||||
? $t.game.components.guessHistory.dead
|
||||
: character.status === 'Unknown'
|
||||
? 'Inconnu'
|
||||
? $t.game.components.guessHistory.unknown
|
||||
: character.status === null
|
||||
? '-'
|
||||
: character.status || 'Inconnu'}
|
||||
: character.status || $t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -251,10 +252,10 @@
|
||||
>
|
||||
<p class="text-center text-xs font-bold text-white sm:text-sm md:text-base">
|
||||
{character.gender === 'Male'
|
||||
? 'Homme'
|
||||
? $t.game.components.guessHistory.male
|
||||
: character.gender === 'Female'
|
||||
? 'Femme'
|
||||
: character.gender || 'Inconnu'}
|
||||
? $t.game.components.guessHistory.female
|
||||
: character.gender || $t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -322,10 +323,10 @@
|
||||
})()} flex items-center justify-center p-1 sm:p-2"
|
||||
>
|
||||
<p class="text-center text-sm font-bold text-white sm:text-lg md:text-2xl">
|
||||
{#if character.hakiObservation}<span title="Haki de l'Observation">👁️</span
|
||||
{#if character.hakiObservation}<span title={$t.game.components.guessHistory.obsHakiTitle}>👁️</span
|
||||
>{/if}
|
||||
{#if character.hakiArmament}<span title="Haki de l'Armement">🦾</span>{/if}
|
||||
{#if character.hakiConqueror}<span title="Haki des Rois">👑</span>{/if}
|
||||
{#if character.hakiArmament}<span title={$t.game.components.guessHistory.armHakiTitle}>🦾</span>{/if}
|
||||
{#if character.hakiConqueror}<span title={$t.game.components.guessHistory.kingHakiTitle}>👑</span>{/if}
|
||||
{#if !character.hakiObservation && !character.hakiArmament && !character.hakiConqueror}
|
||||
<span class="text-2xl sm:text-3xl md:text-5xl">✕</span>
|
||||
{/if}
|
||||
@@ -362,7 +363,7 @@
|
||||
<p
|
||||
class="relative z-10 text-center text-[10px] font-bold text-white sm:text-xs md:text-sm"
|
||||
>
|
||||
Inconnue
|
||||
{$t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -397,7 +398,7 @@
|
||||
<p
|
||||
class="relative z-10 text-center text-[10px] font-bold text-white sm:text-xs md:text-sm"
|
||||
>
|
||||
Inconnue
|
||||
{$t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -412,7 +413,7 @@
|
||||
: 'bg-red-900/60'} flex items-center justify-center p-1 sm:p-2"
|
||||
>
|
||||
<p class="text-center text-[10px] font-bold text-white sm:text-xs md:text-sm">
|
||||
{character.origin || 'Inconnue'}
|
||||
{character.origin || $t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -439,7 +440,7 @@
|
||||
<p
|
||||
class="relative z-10 text-center text-[10px] font-bold text-white sm:text-xs md:text-sm"
|
||||
>
|
||||
{character.arcName || 'Inconnu'}
|
||||
{character.arcName || $t.game.components.guessHistory.unknown}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user