Skip to content

Feature/spanish localization#638

Open
HugoAleOlguin wants to merge 4 commits intopyclashbot:masterfrom
HugoAleOlguin:feature/spanish-localization
Open

Feature/spanish localization#638
HugoAleOlguin wants to merge 4 commits intopyclashbot:masterfrom
HugoAleOlguin:feature/spanish-localization

Conversation

@HugoAleOlguin
Copy link

@HugoAleOlguin HugoAleOlguin commented Feb 16, 2026

Pull Request: Spanish Localization Proposal 🇪🇸

English (GitHub PR)

Title: feat: Spanish Localization with Maintainable Architecture

Description:
This PR proposes an implementation for Spanish localization support, aiming to keep the codebase clean and easy to maintain for future languages.

Proposed Changes:

  • Translation Structure:
    • Moved translation dictionaries to pyclashbot/interface/messages.py to keep data separate from logic.
    • Updated i18n.py to handle language switching and fallbacks.
    • Added a simple _log_missing_key function to help developers identify missing translations in future updates (logs to missing_translations.txt instead of crashing).
  • UI Coverage:
    • Covers most user-facing strings, including dynamic configuration labels (e.g., Google Play settings) and runtime status messages in main.py.
    • Added translations for tooltips and buttons.
  • User Experience:
    • Added a "Language" selector in the Misc tab (defaults to English).
    • Added a confirmation dialog upon language change to ensure the UI reloads correctly.

Motivation:
The goal was to implement localization in a way that is robust to upstream changes. By using English strings as keys and falling back gracefully, the bot remains functional even if a translation is missing after an update.

Verification:

  • Added tests/test_i18n.py to verify the basic translation logic.
  • Manually tested the UI in Spanish to ensure strings fit correctly and the layout remains stable.

Screenshots:
Spanish UI - Main
Spanish UI - Settings


Español (Notas de la Versión)

Título: Propuesta de Traducción al Español

Descripción:
Esta es una propuesta para integrar el idioma español en el bot, buscando una arquitectura que facilite el mantenimiento y la adición de futuros idiomas.

Cambios Principales:

  • Estructura: Se separaron los textos (messages.py) de la lógica (i18n.py) para mantener el código ordenado.
  • Robustez: Si falta alguna traducción en el futuro, el bot simplemente mostrará el texto en inglés y registrará el falta en un archivo de texto para que sea fácil de corregir, sin causar errores.
  • Cobertura: Se tradujeron la mayoría de los textos visibles, incluyendo configuraciones avanzadas y estados del bot.
  • UX: Se añadió un selector de idioma y un aviso de reinicio para asegurar que los cambios se apliquen bien.

Estado:
Probado manualmente y con tests unitarios básicos. Abierto a sugerencias para mejorar la implementación.

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.

1 participant