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,5 +1,5 @@
|
||||
import type { Metadata } from 'next'
|
||||
import { setRequestLocale } from 'next-intl/server'
|
||||
import { setRequestLocale, getTranslations } from 'next-intl/server'
|
||||
import { redirect } from '@/i18n/navigation'
|
||||
import { getSession } from '@/lib/session'
|
||||
import { getSecurityHistory } from '@/lib/security-history'
|
||||
@@ -35,6 +35,7 @@ function UserCell({ label, bnet }: { label: string; bnet: string }) {
|
||||
export default async function SecurityHistoryPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations('History')
|
||||
|
||||
const session = await getSession()
|
||||
if (!session.bnetId) redirect({ href: '/login', locale })
|
||||
@@ -45,39 +46,37 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
const { activity, realm, web } = await getSecurityHistory(session.accountId!, displayUser, bnetEmail)
|
||||
|
||||
return (
|
||||
<PageShell title="Historial de seguridad">
|
||||
<PageShell title={t('security.pageTitle')}>
|
||||
<ServiceBox>
|
||||
<br />
|
||||
<p>Aquí verás información de actividad y conexiones de tu cuenta.</p>
|
||||
<p>Cada tabla tiene una explicación detallada de la información provista.</p>
|
||||
<p>{t('security.intro1')}</p>
|
||||
<p>{t('security.intro2')}</p>
|
||||
<p>
|
||||
Si desconoces algún tipo de actividad te recomendamos cambiar la contraseña de tu cuenta y del correo ligado a
|
||||
la misma.
|
||||
{t('security.intro3')}
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<span>Historial de actividad</span>
|
||||
<span>{t('security.activityTitle')}</span>
|
||||
</p>
|
||||
<p>Muestra actividad de seguridad de la cuenta, como por ejemplo cambios de contraseña.</p>
|
||||
<p>{t('security.activityDesc')}</p>
|
||||
<br />
|
||||
<p>
|
||||
<span>Historial de conexiones (Reino)</span>
|
||||
<span>{t('security.realmTitle')}</span>
|
||||
</p>
|
||||
<p>
|
||||
Muestra un historial de conexiones al reino <u>sólo cuando la IP ha cambiado</u>. No es un historial de cada
|
||||
conexión.
|
||||
{t.rich('security.realmDesc', { u: (c) => <u>{c}</u> })}
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<span>Historial de conexiones (Web)</span>
|
||||
<span>{t('security.webTitle')}</span>
|
||||
</p>
|
||||
<p>Muestra un historial de cada conexión al sitio web.</p>
|
||||
<p>{t('security.webDesc')}</p>
|
||||
</ServiceBox>
|
||||
|
||||
{/* Historial de actividad */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content">
|
||||
<h2>Historial de actividad</h2>
|
||||
<h2>{t('security.activityTitle')}</h2>
|
||||
</div>
|
||||
<div className="body-box-content centered">
|
||||
{activity.length === 0 ? (
|
||||
@@ -85,7 +84,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>No hay actividad</span>
|
||||
<span>{t('security.noActivity')}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -94,10 +93,10 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<table className="max-center-table-aligned2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Usuario</th>
|
||||
<th>Acción</th>
|
||||
<th>{t('security.thUser')}</th>
|
||||
<th>{t('security.thAction')}</th>
|
||||
<th>IP</th>
|
||||
<th>Fecha</th>
|
||||
<th>{t('security.thDate')}</th>
|
||||
</tr>
|
||||
{activity.map((a, i) => (
|
||||
<tr key={i}>
|
||||
@@ -122,7 +121,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
{/* Historial de conexiones (Reino) */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content">
|
||||
<h2>Historial de conexiones (Reino)</h2>
|
||||
<h2>{t('security.realmTitle')}</h2>
|
||||
</div>
|
||||
<div className="body-box-content centered">
|
||||
{realm.length === 0 ? (
|
||||
@@ -130,7 +129,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>No hay conexiones</span>
|
||||
<span>{t('security.noConnections')}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -140,7 +139,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>Fecha</th>
|
||||
<th>{t('security.thDate')}</th>
|
||||
</tr>
|
||||
{realm.map((c, i) => (
|
||||
<tr key={i}>
|
||||
@@ -161,7 +160,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
{/* Historial de conexiones (Web) */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content">
|
||||
<h2>Historial de conexiones (Web)</h2>
|
||||
<h2>{t('security.webTitle')}</h2>
|
||||
</div>
|
||||
<div className="body-box-content centered">
|
||||
{web.length === 0 ? (
|
||||
@@ -169,7 +168,7 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>No hay conexiones</span>
|
||||
<span>{t('security.noConnections')}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -178,10 +177,10 @@ export default async function SecurityHistoryPage({ params }: { params: Promise<
|
||||
<table className="max-center-table-aligned">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Usuario</th>
|
||||
<th>Estado</th>
|
||||
<th>{t('security.thUser')}</th>
|
||||
<th>{t('security.thStatus')}</th>
|
||||
<th>IP</th>
|
||||
<th>Fecha</th>
|
||||
<th>{t('security.thDate')}</th>
|
||||
</tr>
|
||||
{web.map((c, i) => (
|
||||
<tr key={i}>
|
||||
|
||||
Reference in New Issue
Block a user