i18n: traducir toda la app (ES + EN) — páginas y componentes con texto hardcodeado

Se externaliza el texto español hardcodeado de ~55 archivos a next-intl y se añaden
traducciones al inglés, con paridad de claves es/en. Nuevos namespaces: History,
CharService, CharServiceB, Points, Legal, UI, Misc (+ altas en Common/Admin).

- Historiales (PD/PV, transacciones, sanciones, seguridad), servicios de personaje
  (transfer, send-gift, quest, restore-*, change-*, customize, level-up, gold, rename),
  PD/pagos (d-points, trade, promo, transfer-dp, rename-guild, DPointsTabs), páginas
  legales (cookies, privacidad, términos, reembolsos, aviso legal, contacto), layout
  (cabecera, footer, cookies, 2FA, descargas, jugadores, recluta) y páginas varias
  (home, reino, ayuda, addons, 2falogin).
- Textos con markup inline via t.rich; interpolación con ICU.
- Componente <NoteLegend/> para la leyenda NOTA/NOTE compartida.
- payLabel/confirmText de los servicios de pago traducidos.
- Verificado: tsc OK, next build OK, todas las claves t() resuelven en es y en,
  todos los t.rich casan etiquetas, páginas 200 en /es/ y /en/ sin claves crudas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 18:58:54 +00:00
parent e457a43f05
commit 651d8deafc
57 changed files with 3516 additions and 1190 deletions
+11 -9
View File
@@ -1,6 +1,7 @@
'use client'
import { useState } from 'react'
import { useTranslations } from 'next-intl'
import { CharacterSelect, type CharOption } from '@/components/CharacterSelect'
/** Campo con ojo para mostrar/ocultar (contraseña / token). */
@@ -42,6 +43,7 @@ function SecretInput({
}
export function TransferForm({ characters, price }: { characters: CharOption[]; price: number }) {
const t = useTranslations('CharService')
const [character, setCharacter] = useState('')
const [destination, setDestination] = useState('')
const [password, setPassword] = useState('')
@@ -52,7 +54,7 @@ export function TransferForm({ characters, price }: { characters: CharOption[];
async function handleSubmit(e: React.FormEvent) {
e.preventDefault()
if (busy || !character || !destination.trim() || !password || !token.trim()) return
if (!window.confirm(`¿Estás seguro de transferir el personaje "${character}" a la cuenta ${destination.trim()} por ${price} € (SumUp)?`)) return
if (!window.confirm(t('transfer.confirm', { character, destination: destination.trim(), price }))) return
setBusy(true)
setError(null)
try {
@@ -71,30 +73,30 @@ export function TransferForm({ characters, price }: { characters: CharOption[];
const data: { success?: boolean; url?: string; message?: string } = await res.json()
if (data.success && data.url) window.location.href = data.url
else {
setError(data.message || 'No se pudo iniciar la transferencia. Inténtalo de nuevo.')
setError(data.message || t('transfer.errorGeneric'))
setBusy(false)
}
} catch {
setError('Algo ha salido mal. Inténtalo más tarde.')
setError(t('transfer.errorUnexpected'))
setBusy(false)
}
}
if (characters.length === 0) return <p className="second-brown">No tienes personajes disponibles.</p>
if (characters.length === 0) return <p className="second-brown">{t('transfer.noCharacters')}</p>
return (
<div className="centered">
<form id="uw-transfer-character-form" onSubmit={handleSubmit} acceptCharset="utf-8">
<CharacterSelect characters={characters} value={character} onChange={setCharacter} placeholder="Selecciona un personaje" />
<CharacterSelect characters={characters} value={character} onChange={setCharacter} placeholder={t('transfer.selectPlaceholder')} />
<br />
<input type="text" maxLength={32} placeholder="Cuenta de destino" value={destination} onChange={(e) => setDestination(e.target.value)} required />
<input type="text" maxLength={32} placeholder={t('transfer.destinationPlaceholder')} value={destination} onChange={(e) => setDestination(e.target.value)} required />
<br />
<SecretInput id="password" value={password} onChange={setPassword} placeholder="Contraseña de tu cuenta" maxLength={16} toggleClass="toggle-password" />
<SecretInput id="password" value={password} onChange={setPassword} placeholder={t('transfer.passwordPlaceholder')} maxLength={16} toggleClass="toggle-password" />
<br />
<SecretInput id="security-token" value={token} onChange={setToken} placeholder="Token de seguridad" maxLength={6} toggleClass="toggle-token" />
<SecretInput id="security-token" value={token} onChange={setToken} placeholder={t('transfer.tokenPlaceholder')} maxLength={6} toggleClass="toggle-token" />
<br />
<button type="submit" className="transfer-button" disabled={busy || !character || !destination.trim() || !password || !token.trim()}>
{busy ? 'Transfiriendo personaje' : 'TRANSFERIR PERSONAJE'}
{busy ? t('transfer.submitting') : t('transfer.submit')}
</button>
</form>
<hr />