651d8deafc
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>
73 lines
2.7 KiB
TypeScript
73 lines
2.7 KiB
TypeScript
import type { Metadata } from 'next'
|
|
import { getTranslations, setRequestLocale } from 'next-intl/server'
|
|
import { redirect, Link } from '@/i18n/navigation'
|
|
import { getSession } from '@/lib/session'
|
|
import { is2faEnabled } from '@/lib/two-factor'
|
|
import { PageShell } from '@/components/PageShell'
|
|
import { TwoFactorLogin } from '@/components/TwoFactorLogin'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export const metadata: Metadata = { title: 'Verificación en 2 pasos' }
|
|
|
|
const IMG = '/nw-themes/nw-ryu/nw-images'
|
|
|
|
export default async function Security2faLoginPage({ params }: { params: Promise<{ locale: string }> }) {
|
|
const { locale } = await params
|
|
setRequestLocale(locale)
|
|
const t = await getTranslations('Misc')
|
|
|
|
const session = await getSession()
|
|
if (!session.bnetId) redirect({ href: '/login', locale })
|
|
if (!session.username) redirect({ href: '/select-account', locale })
|
|
|
|
const enabled = session.accountId ? await is2faEnabled(session.accountId) : false
|
|
|
|
return (
|
|
<PageShell title={t('twofaLogin.pageTitle')}>
|
|
<div className="box-content">
|
|
<div className="title-box-content">
|
|
<h2>{t('twofaLogin.info')}</h2>
|
|
<Link className="back-to-account" href="/my-account">{t('twofaLogin.backToAccount')}</Link>
|
|
<Link className="back-to-account-responsive" href="/my-account">{t('twofaLogin.back')}</Link>
|
|
</div>
|
|
<div className="body-box-content justified">
|
|
<br />
|
|
<div className="twofa-login-info">
|
|
<img
|
|
className="twofa-login-preview"
|
|
src={`${IMG}/nw-general/nw-authenticator-preview.png`}
|
|
alt={t('twofaLogin.previewAlt')}
|
|
/>
|
|
<div className="twofa-login-info-text">
|
|
<p>{t.rich('twofaLogin.p1', { s: (c) => <span>{c}</span> })}</p>
|
|
<br />
|
|
<p>{t('twofaLogin.p2')}</p>
|
|
<p>{t('twofaLogin.p3')}</p>
|
|
<br />
|
|
<p>{t('twofaLogin.p4')}</p>
|
|
<br />
|
|
<p><span>{t('twofaLogin.backupCodes')}</span></p>
|
|
<p>{t('twofaLogin.p5')}</p>
|
|
<p>{t('twofaLogin.p6')}</p>
|
|
<p>{t('twofaLogin.p7')}</p>
|
|
<p>{t('twofaLogin.p8')}</p>
|
|
<br />
|
|
<p>{t.rich('twofaLogin.requestToken', { link: (c) => <Link href="/security-token" target="_blank">{c}</Link> })}</p>
|
|
<br />
|
|
</div>
|
|
</div>
|
|
<fieldset>
|
|
<legend>{t('twofaLogin.note')}</legend>
|
|
<div className="separate2">
|
|
<p>{t('twofaLogin.noteText')}</p>
|
|
</div>
|
|
</fieldset>
|
|
|
|
<TwoFactorLogin enabled={enabled} />
|
|
</div>
|
|
</div>
|
|
</PageShell>
|
|
)
|
|
}
|