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,3 +1,4 @@
|
||||
import { getTranslations } from 'next-intl/server'
|
||||
import {
|
||||
getPlayersData,
|
||||
CLASS_INFO,
|
||||
@@ -11,19 +12,20 @@ import {
|
||||
/* eslint-disable @next/next/no-img-element */
|
||||
|
||||
export async function PlayersBoard() {
|
||||
const t = await getTranslations('UI')
|
||||
const data = await getPlayersData()
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="box-content">
|
||||
<div className="body-box-content centered">
|
||||
<p><i className="fas fa-exclamation-triangle"></i> La información de esta página se actualiza 1 vez al día automáticamente</p>
|
||||
<p><i className="fas fa-exclamation-triangle"></i> {t('players.updateNotice')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Personajes creados por clase */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content centered"><h2>Personajes creados por clase</h2></div>
|
||||
<div className="title-box-content centered"><h2>{t('players.charsByClass')}</h2></div>
|
||||
<div className="body-box-content centered">
|
||||
<div className="show-players">
|
||||
{data.classStats.map((s) => (
|
||||
@@ -31,10 +33,10 @@ export async function PlayersBoard() {
|
||||
<table className="players-table">
|
||||
<tbody>
|
||||
<tr><td><img className="img-med-icon chest-medium" src={classChest(s.id)} alt={CLASS_INFO[s.id].label} /></td></tr>
|
||||
<tr><td><span className={s.key}>Total: <span>{s.total}</span></span></td></tr>
|
||||
<tr><td><span className={s.key}>{t('players.total')} <span>{s.total}</span></span></td></tr>
|
||||
<tr><td><hr /></td></tr>
|
||||
<tr><td className="lefted"><img className="img-small-icon-m img-align" src={ALLIANCE_ICON} alt="Alianza" /> <span className={s.key}>Alianzas: <span>{s.alliance}</span></span></td></tr>
|
||||
<tr><td className="lefted"><img className="img-small-icon-m img-align" src={HORDE_ICON} alt="Horda" /> <span className={s.key}>Hordas: <span>{s.horde}</span></span></td></tr>
|
||||
<tr><td className="lefted"><img className="img-small-icon-m img-align" src={ALLIANCE_ICON} alt={t('players.allianceAlt')} /> <span className={s.key}>{t('players.alliances')} <span>{s.alliance}</span></span></td></tr>
|
||||
<tr><td className="lefted"><img className="img-small-icon-m img-align" src={HORDE_ICON} alt={t('players.hordeAlt')} /> <span className={s.key}>{t('players.hordes')} <span>{s.horde}</span></span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -42,9 +44,9 @@ export async function PlayersBoard() {
|
||||
<table className="max-center-table2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Personajes totales: <span>{data.totals.total}</span></td>
|
||||
<td><span className="alliance-color">Personajes alianzas:</span> <span>{data.totals.alliance}</span></td>
|
||||
<td><span className="horde-color">Personajes hordas:</span> <span>{data.totals.horde}</span></td>
|
||||
<td>{t('players.totalChars')} <span>{data.totals.total}</span></td>
|
||||
<td><span className="alliance-color">{t('players.allianceChars')}</span> <span>{data.totals.alliance}</span></td>
|
||||
<td><span className="horde-color">{t('players.hordeChars')}</span> <span>{data.totals.horde}</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -56,23 +58,23 @@ export async function PlayersBoard() {
|
||||
|
||||
{/* Primeros del Reino - Nivel 80 */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content centered"><h2>Primeros del Reino - Nivel 80</h2></div>
|
||||
<div className="title-box-content centered"><h2>{t('players.firstsTitle')}</h2></div>
|
||||
<div className="body-box-content justified">
|
||||
{data.firsts.length === 0 ? (
|
||||
<p className="centered second-brown">Aún no hay personajes de nivel 80 registrados.</p>
|
||||
<p className="centered second-brown">{t('players.noLevel80')}</p>
|
||||
) : (
|
||||
<table className="max-left-table2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Logro</th>
|
||||
<th>Personaje</th>
|
||||
<th className="responsive-td">Fecha</th>
|
||||
<th>{t('players.thAchievement')}</th>
|
||||
<th>{t('players.thCharacter')}</th>
|
||||
<th className="responsive-td">{t('players.thDate')}</th>
|
||||
</tr>
|
||||
{data.firsts.map((f, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
<img className="img-small-icon img-small-icon-h img-align" src={f.icon} alt="" />{' '}
|
||||
<span className="yellow-info"><span className="yellow-info responsive-td">¡Primero del reino!</span><span className="yellow-info"> {f.label}</span></span>
|
||||
<span className="yellow-info"><span className="yellow-info responsive-td">{t('players.firstOfRealm')}</span><span className="yellow-info"> {f.label}</span></span>
|
||||
</td>
|
||||
<td className={`${f.classKey} big-font`}>{f.name}</td>
|
||||
<td className="responsive-td"><span>{f.date}</span></td>
|
||||
@@ -88,16 +90,16 @@ export async function PlayersBoard() {
|
||||
|
||||
{/* Top de logros */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content centered"><h2>Top de logros</h2></div>
|
||||
<div className="title-box-content centered"><h2>{t('players.topAchTitle')}</h2></div>
|
||||
<div className="body-box-content centered">
|
||||
<p>Los 10 jugadores con más logros</p>
|
||||
<p>{t('players.topAchSub')}</p>
|
||||
<table className="char-center-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Nombre</th>
|
||||
<th>Raza</th>
|
||||
<th>Clase</th>
|
||||
<th>Puntos de logros</th>
|
||||
<th>{t('players.thName')}</th>
|
||||
<th>{t('players.thRace')}</th>
|
||||
<th>{t('players.thClass')}</th>
|
||||
<th>{t('players.thAchPoints')}</th>
|
||||
</tr>
|
||||
{data.topAch.map((r, i) => (
|
||||
<tr key={i}>
|
||||
@@ -116,17 +118,17 @@ export async function PlayersBoard() {
|
||||
|
||||
{/* Top de muertes con honor */}
|
||||
<div className="box-content">
|
||||
<div className="title-box-content centered"><h2>Top de muertes con honor</h2></div>
|
||||
<div className="title-box-content centered"><h2>{t('players.topHonorTitle')}</h2></div>
|
||||
<div className="body-box-content centered">
|
||||
<p>Los 10 jugadores con más muertes con honor</p>
|
||||
<p>{t('players.topHonorSub')}</p>
|
||||
<table className="char-center-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Nombre</th>
|
||||
<th>Raza</th>
|
||||
<th>Clase</th>
|
||||
<th>Total de muertes</th>
|
||||
<th>Total de muertes hoy</th>
|
||||
<th>{t('players.thName')}</th>
|
||||
<th>{t('players.thRace')}</th>
|
||||
<th>{t('players.thClass')}</th>
|
||||
<th>{t('players.thTotalKills')}</th>
|
||||
<th>{t('players.thTodayKills')}</th>
|
||||
</tr>
|
||||
{data.topHonor.map((r, i) => (
|
||||
<tr key={i}>
|
||||
|
||||
Reference in New Issue
Block a user