From 033ebc6861e6e6e40d728c3bb3f2a40058df3aeb Mon Sep 17 00:00:00 2001 From: adevopg Date: Tue, 14 Jul 2026 22:41:58 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20tooltips=20de=20wowhead=20en=20el=20idio?= =?UTF-8?q?ma=20de=20la=20web=20(no=20siempre=20ingl=C3=A9s)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El script de tooltips prioriza el atributo data-wowhead sobre el subdominio del href, y su parámetro `domain` codifica idioma + versión: el 1.er segmento va al mapa de locales ({es:6,...}) y el resto a la versión (wotlk=WRATH). Antes se enviaba `domain=wotlk` (sin idioma) → locale 0 = inglés siempre. Ahora `wowheadData(type,id,locale)` genera `domain=es.wotlk` en español (locale 6) y `domain=wotlk` en inglés. Verificado: el endpoint de datos con locale 6 devuelve los nombres en español. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../app/[locale]/quest-character/page.tsx | 6 ++--- web-next/components/RecruitPanel.tsx | 2 +- web-next/components/WowheadLink.tsx | 2 +- web-next/lib/wowhead.ts | 24 ++++++++++++++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/web-next/app/[locale]/quest-character/page.tsx b/web-next/app/[locale]/quest-character/page.tsx index 602d004..270dcb3 100644 --- a/web-next/app/[locale]/quest-character/page.tsx +++ b/web-next/app/[locale]/quest-character/page.tsx @@ -66,7 +66,7 @@ export default async function QuestCharacterPage({ params }: { params: Promise<{ {o.link ? (
  • {t.rich('quest.hodir', { - hodir: (c) => {c}, - lille: (c) => {c}, + hodir: (c) => {c}, + lille: (c) => {c}, })}
  • diff --git a/web-next/components/RecruitPanel.tsx b/web-next/components/RecruitPanel.tsx index 834ed43..33a7757 100644 --- a/web-next/components/RecruitPanel.tsx +++ b/web-next/components/RecruitPanel.tsx @@ -78,7 +78,7 @@ export function RecruitPanel({ <> = { es: 'es' } + +function wowheadDomain(locale: string): string { + const code = LOCALE_WH_CODE[locale] + return code ? `${code}.wotlk` : 'wotlk' +} + +/** + * Valor del atributo `data-wowhead`, para que el tooltip salga en la rama WotLK + * y EN EL IDIOMA de la web. El `domain` lleva el idioma (p.ej. `es.wotlk`) porque + * el script prioriza este atributo sobre el subdominio del href; sin el idioma + * aquí, el tooltip saldría en inglés aunque el enlace sea es.wowhead.com. + */ +export function wowheadData(type: WowheadType, id: number | string, locale: string): string { + return `${type}=${id}&domain=${wowheadDomain(locale)}` }