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 { getPaymentTransactions, type PaymentTx } from '@/lib/trans-history'
|
||||
@@ -21,7 +21,7 @@ function StatusBadge({ status }: { status: PaymentTx['status'] }) {
|
||||
}
|
||||
|
||||
/** Caja de una pasarela con su tabla de transacciones (o "No hay movimientos"). */
|
||||
function PlatformBox({
|
||||
async function PlatformBox({
|
||||
name,
|
||||
logo,
|
||||
note,
|
||||
@@ -32,6 +32,7 @@ function PlatformBox({
|
||||
note: string
|
||||
txs: PaymentTx[]
|
||||
}) {
|
||||
const t = await getTranslations('History')
|
||||
return (
|
||||
<div className="box-content">
|
||||
<div className="title-box-content">
|
||||
@@ -41,12 +42,11 @@ function PlatformBox({
|
||||
</div>
|
||||
<div className="body-box-content">
|
||||
<p>
|
||||
Recibirás los PD correspondientes a cada transacción sólo cuando esté aprobada y el estado sea{' '}
|
||||
<span className="green-info2">PAID</span> (Pagado).
|
||||
{t.rich('trans.paidNote', { s: (c) => <span className="green-info2">{c}</span> })}
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<span className="red-info2">Importante:</span> {note}
|
||||
<span className="red-info2">{t('trans.important')}</span> {note}
|
||||
</p>
|
||||
<br />
|
||||
{txs.length === 0 ? (
|
||||
@@ -54,7 +54,7 @@ function PlatformBox({
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>No hay movimientos</span>
|
||||
<span>{t('trans.noMovements')}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -63,11 +63,11 @@ function PlatformBox({
|
||||
<table className="max-center-table-aligned">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>ID de transacción</th>
|
||||
<th>Estado</th>
|
||||
<th className="responsive-td">Concepto</th>
|
||||
<th>Fecha creación</th>
|
||||
<th>Cantidad</th>
|
||||
<th>{t('trans.thTxId')}</th>
|
||||
<th>{t('trans.thStatus')}</th>
|
||||
<th className="responsive-td">{t('trans.thConcept')}</th>
|
||||
<th>{t('trans.thCreatedAt')}</th>
|
||||
<th>{t('trans.thAmount')}</th>
|
||||
</tr>
|
||||
{txs.map((t) => (
|
||||
<tr key={t.id}>
|
||||
@@ -101,6 +101,7 @@ const LOGO_BASE = '/nw-themes/nw-ryu/nw-images/nw-logos'
|
||||
export default async function TransHistoryPage({ 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 })
|
||||
@@ -111,23 +112,23 @@ export default async function TransHistoryPage({ params }: { params: Promise<{ l
|
||||
const sumup = txs.filter((t) => t.platform === 'SumUp')
|
||||
|
||||
return (
|
||||
<PageShell title="Historial de transacciones">
|
||||
<PageShell title={t('trans.pageTitle')}>
|
||||
<ServiceBox>
|
||||
<br />
|
||||
<p>Aquí verás la información que recibimos de nuestras diferentes plataformas de pago automáticas.</p>
|
||||
<p>{t('trans.intro1')}</p>
|
||||
<br />
|
||||
<p>¿Has tenido algún problema con alguna transacción?</p>
|
||||
<p>{t('trans.intro2')}</p>
|
||||
<p>
|
||||
Si has tenido un problema con una de las transacciones o no has recibido tus PD, puedes contactarnos en
|
||||
nuestro Discord o a través del correo{' '}
|
||||
<a href="mailto:contacto@ultimowow.com">contacto@ultimowow.com</a>.
|
||||
{t.rich('trans.intro3', {
|
||||
mail: (c) => <a href="mailto:contacto@ultimowow.com">{c}</a>,
|
||||
})}
|
||||
</p>
|
||||
</ServiceBox>
|
||||
<br />
|
||||
<PlatformBox
|
||||
name="Stripe"
|
||||
logo={`${LOGO_BASE}/stripe-p-logo.svg`}
|
||||
note="Los pagos con tarjeta se aprueban normalmente en unos segundos."
|
||||
note={t('trans.noteStripe')}
|
||||
txs={stripe}
|
||||
/>
|
||||
<br />
|
||||
@@ -136,7 +137,7 @@ export default async function TransHistoryPage({ params }: { params: Promise<{ l
|
||||
<PlatformBox
|
||||
name="SumUp"
|
||||
logo={`${LOGO_BASE}/sumup-p-logo.svg`}
|
||||
note="SumUp puede tardar unos minutos en confirmar el pago tras completar el checkout."
|
||||
note={t('trans.noteSumup')}
|
||||
txs={sumup}
|
||||
/>
|
||||
</PageShell>
|
||||
|
||||
Reference in New Issue
Block a user