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:
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { useLocale } from 'next-intl'
|
||||
import { useLocale, useTranslations } from 'next-intl'
|
||||
import { Link } from '@/i18n/navigation'
|
||||
|
||||
const SERVER_NAME = 'NovaWoW'
|
||||
@@ -27,6 +27,7 @@ export function SiteHeader({
|
||||
playersHref: string
|
||||
}) {
|
||||
const locale = useLocale()
|
||||
const t = useTranslations('UI')
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
return (
|
||||
@@ -46,21 +47,21 @@ export function SiteHeader({
|
||||
</a>
|
||||
|
||||
{loggedIn ? (
|
||||
<Link href="/">INICIO</Link>
|
||||
<Link href="/">{t('header.home')}</Link>
|
||||
) : (
|
||||
<Link href="/register">CREAR CUENTA</Link>
|
||||
<Link href="/register">{t('header.register')}</Link>
|
||||
)}
|
||||
|
||||
<div className="nav-dropdown">
|
||||
<div className="nav-dropdown-btn">
|
||||
DESCARGAS <i className="fas fa-caret-down"></i>
|
||||
{t('header.downloads')} <i className="fas fa-caret-down"></i>
|
||||
</div>
|
||||
<div className="nav-dropdown-content">
|
||||
<p>
|
||||
<Link href="/download-client">CLIENTE</Link>
|
||||
<Link href="/download-client">{t('header.client')}</Link>
|
||||
</p>
|
||||
<p>
|
||||
<Link href="/download-addons">ADDONS</Link>
|
||||
<Link href="/download-addons">{t('header.addons')}</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,14 +72,14 @@ export function SiteHeader({
|
||||
</div>
|
||||
<div className="nav-dropdown-content">
|
||||
<p>
|
||||
<Link href="/changelogs">CHANGELOG</Link>
|
||||
<Link href="/changelogs">{t('header.changelog')}</Link>
|
||||
</p>
|
||||
<p>
|
||||
<Link href={realmHref}>REINO</Link>
|
||||
<Link href={realmHref}>{t('header.realm')}</Link>
|
||||
</p>
|
||||
{loggedIn && (
|
||||
<p>
|
||||
<Link href={playersHref}>JUGADORES</Link>
|
||||
<Link href={playersHref}>{t('header.players')}</Link>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -86,23 +87,23 @@ export function SiteHeader({
|
||||
|
||||
<div className="nav-dropdown">
|
||||
<div className="nav-dropdown-btn">
|
||||
COMUNIDAD <i className="fas fa-caret-down"></i>
|
||||
{t('header.community')} <i className="fas fa-caret-down"></i>
|
||||
</div>
|
||||
<div className="nav-dropdown-content">
|
||||
<p>
|
||||
<Link href="/forum">FOROS</Link>
|
||||
<Link href="/forum">{t('header.forums')}</Link>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://wotlk.novawow.com" target="_blank" rel="noopener noreferrer">
|
||||
WOTLK DB
|
||||
{t('header.wotlkDb')}
|
||||
</a>
|
||||
</p>
|
||||
<p>
|
||||
<Link href="/content-creators">VIDEOS</Link>
|
||||
<Link href="/content-creators">{t('header.videos')}</Link>
|
||||
</p>
|
||||
{loggedIn && (
|
||||
<p>
|
||||
<Link href="/help">AYUDA</Link>
|
||||
<Link href="/help">{t('header.help')}</Link>
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -115,16 +116,16 @@ export function SiteHeader({
|
||||
</div>
|
||||
<div className="nav-dropdown-content">
|
||||
<p>
|
||||
<Link href="/my-account">MI CUENTA</Link>
|
||||
<Link href="/my-account">{t('header.myAccount')}</Link>
|
||||
</p>
|
||||
<p>
|
||||
<a href={`/${locale}/log-out`}>DESCONECTAR</a>
|
||||
<a href={`/${locale}/log-out`}>{t('header.logout')}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Link href="/login" className="last">
|
||||
CONECTAR
|
||||
{t('header.login')}
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user