Noticias multiidioma (ES/EN) con fallback

home_noticia gana columnas titulo_en/contenido_en (sql/add_news_en.sql). getNoticias(locale)
usa la versión EN si existe, si no cae al español (título y contenido independientes); la fecha
también se formatea por idioma. El panel de admin permite escribir la traducción al crear y EDITAR
noticias existentes (nuevo PUT /api/admin/news/[id], updateNews). Claves Admin nuevas (título/
contenido EN, editar/guardar). Probado: /en/ muestra EN, /es/ ES; PUT guardado (403 sin sesión).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 19:14:07 +00:00
parent 81e1450e6b
commit 86c9b01c76
9 changed files with 162 additions and 39 deletions
+7 -1
View File
@@ -566,7 +566,13 @@
"promoEmptyError": "Enter the code and at least PD or PV (with max uses ≥ 1).",
"forum": "Forums",
"search": "Search",
"promoConfirmDelete": "Delete this promo code?"
"promoConfirmDelete": "Delete this promo code?",
"newsTitleEn": "Title (English, optional)",
"newsContentEn": "Content (English, optional)",
"edit": "Edit",
"saving": "Saving…",
"cancel": "Cancel",
"newsEnHint": "Leave English empty to fall back to Spanish on the English site."
},
"Vote": {
"title": "Vote for us",
+7 -1
View File
@@ -566,7 +566,13 @@
"promoEmptyError": "Escribe el código y al menos PD o PV (con usos máx. ≥ 1).",
"forum": "Foros",
"search": "Buscar",
"promoConfirmDelete": "¿Borrar este código de promoción?"
"promoConfirmDelete": "¿Borrar este código de promoción?",
"newsTitleEn": "Título (inglés, opcional)",
"newsContentEn": "Contenido (inglés, opcional)",
"edit": "Editar",
"saving": "Guardando…",
"cancel": "Cancelar",
"newsEnHint": "Deja el inglés vacío para usar el español en la web en inglés."
},
"Vote": {
"title": "Votar por nosotros",