i18n: títulos de pestaña por idioma (metadata -> generateMetadata)
Los <title> estáticos estaban en español fijo. Se migran 31 páginas a generateMetadata reutilizando la clave de título ya traducida de cada página (o del <h1>). Se traducen además los PageShell title hardcodeados de las 6 páginas CharServiceB y los títulos de download-client y changelogs (+ su mensaje de error). tsc/build OK, paridad es/en, <title> cambia por idioma. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
import type { Metadata } from 'next'
|
||||
import { getTranslations, setRequestLocale } from 'next-intl/server'
|
||||
import { ClientDownload } from '@/components/ClientDownload'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Descarga del cliente',
|
||||
export async function generateMetadata({ params }: { params: Promise<{ locale: string }> }): Promise<Metadata> {
|
||||
const { locale } = await params
|
||||
const t = await getTranslations({ locale, namespace: 'UI' })
|
||||
return { title: t('clientDownload.pageTitle') }
|
||||
}
|
||||
|
||||
export default function DownloadClientPage() {
|
||||
export default async function DownloadClientPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||
const { locale } = await params
|
||||
setRequestLocale(locale)
|
||||
const t = await getTranslations('UI')
|
||||
return (
|
||||
<div className="main-page">
|
||||
<div className="middle-content">
|
||||
<div className="body-content">
|
||||
<div className="title-content">
|
||||
<h1>Descarga del cliente</h1>
|
||||
<h1>{t('clientDownload.pageTitle')}</h1>
|
||||
</div>
|
||||
<ClientDownload />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user