Skip to content

feat: add sponsors translations#47

Merged
francescarpi merged 15 commits intomainfrom
feat_langs
Jan 30, 2026
Merged

feat: add sponsors translations#47
francescarpi merged 15 commits intomainfrom
feat_langs

Conversation

@itziarZG
Copy link
Collaborator

@itziarZG itziarZG commented Jan 27, 2026

This PR implements Internationalization (i18n) for the PyConES 2026 website, specifically focusing on the Sponsors page and landing components. It introduces support for English (en), Spanish (es), and Catalan (ca).

Key Changes

  • i18n Infrastructure: * Added translation files (.ts) for all sponsor-related content (tiers, benefits, testimonials, and past sponsors).
    Implemented a middleware to handle automatic language detection based on the user's browser settings (Accept-Language).

  • Routing & Structure:
    Refactored page structure to use dynamic routing: moved pages to src/pages/[lang]/.
    Updated astro.config.mjs to configure the i18n routing strategy.

  • UI/UX Improvements:
    Localized the landing page elements (Hero title, subtitle, and CTA buttons).
    Updated the Layout.astro to dynamically set the lang attribute in the HTML tag for better accessibility and SEO.

  • Technical Cleanup:
    Centralized text constants to improve maintainability.
    Refactored the main index and sponsors pages to consume translated strings via a helper.

  • Languages Added:
    Spanish es
    English en
    Catalan ca

@itziarZG itziarZG marked this pull request as ready for review January 27, 2026 22:15
Copy link
Collaborator

@ctrl-alt-d ctrl-alt-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Me ha parecido muy bien adaptado al patrón i18n de Astro a la vez que la presentación aparece una vez y el contenido si está internacionalizado. Genial.

Sería interesante configurar el Browser language detection, tengo el Browser en ca y la página me aparece es es.

@ctrl-alt-d
Copy link
Collaborator

@itziarZG , he estado mirando como respetar el idioma del navegador del usuario. No he sabido hacerlo sin un middleware y he tenido que eliminar el prerender de /. Lo verás en #49. Quizá tú conozcas alguna solución más limpia.

Para mi gusto, la solución final sería:

Prioridad Fuente de idioma Ejemplo Quién lo controla
1 URL (/es/, /en/) /es/blog/ Routing / SEO
2 Cookie (pycon_language) pycon_language=es Usuario desde menú cambio idioma
3 Navegador (Accept-Language) es-ES,es;q=0.9,en;q=0.8 Navegador
4 Default (DEFAULT_LANG) en Configuración

(Ahora tenemos 1,3,4 no tenemos la 2)

ctrl-alt-d and others added 3 commits January 28, 2026 19:12
Add middleware to detect browser language

---------

Co-authored-by: itziarZG <itziar.zameza.dev@gmail.com>
@itziarZG itziarZG requested a review from francescarpi January 28, 2026 18:40
Copy link
Collaborator

@ctrl-alt-d ctrl-alt-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creo que hay un error en el contenido (en los tres idiomas)

Accés a sopar de ponents

Per evitar residus, els obsequis i fullets només estaran als stands i taules de patrocinadors, no a les bosses de benvinguda. Si no tens dret a stand, podràs deixar els teus fullets/obsequis en una taula compartida a la zona principal.

Diría que eso forma parte del apartado Obsequio/folleto

Hola @itziarZG ,

me molesta que la home esté en `https://2026.es.pycon.org/es` en vez de,
directamente, en `https://2026.es.pycon.org/`

He escrito esta modificación:
* Index en un componente.
* `src/pages/index.astro` mantiene el JS pero solo redirige si `lang !==
'es'`, en caso contrario muestre el componente en `es`.
* `src/pages/[lang]/index.astro` muestra el componente.

A mí lo que me molaría es que fuera `Astro` quien, en función del
lenguaje del navegador, gestionara la `i18n`, pero no veo que eso sea
una out of the box feature.

Yo no soy experto en front-end ni mucho menos en `Astro`, por eso te lo
envío como PR para que lo valores, quizá existe algún otro sistema más
elegante.
@ctrl-alt-d
Copy link
Collaborator

ctrl-alt-d commented Jan 30, 2026

Pendiente:

ctrl-alt-d and others added 2 commits January 30, 2026 16:58
Añade LanguagePicker. No contiene estilo, solamente elementos DOM y
lógica JS.
@francescarpi francescarpi merged commit 0cbb97d into main Jan 30, 2026
1 check passed
@francescarpi francescarpi deleted the feat_langs branch January 30, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants