feat(i18n): add complete Spanish (es) translation#2
feat(i18n): add complete Spanish (es) translation#2erbolamm wants to merge 3 commits intoZhilips:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Spanish (es) localization support to Zperiod by wiring the new locale into the language controller and translation registries, and introducing full Spanish datasets for UI strings, elements, and ions.
Changes:
- Register
esas a supported language and add dynamic loaders for Spanish element/ion locale data. - Add Spanish UI translation module and include it in translation registries.
- Add full Spanish element (118) and ion (43) locale datasets.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| js/modules/langController.js | Adds es to supported languages and registers dynamic loaders for Spanish element/ion data. |
| js/data/translations.js | Registers esUI in the main translations map. |
| js/data/translations_aggregator.js | Registers esUI in the aggregator translations map. |
| js/data/locales/ui/es.js | Adds full Spanish UI string translations. |
| js/data/locales/es.js | Adds Spanish element dataset. |
| js/data/locales/ions/es.js | Adds Spanish ion dataset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| const STORAGE_KEY = "zperiod_lang"; | ||
| const SUPPORTED = ["en", "zh", "zh-Hant", "fr", "ru", "fa", "ur", "tl"]; | ||
| const SUPPORTED = ["en", "zh", "zh-Hant", "fr", "ru", "fa", "ur", "tl", "es"]; |
There was a problem hiding this comment.
SUPPORTED now includes es, but the language selection UI is still hardcoded elsewhere (e.g., the .lang-option buttons in index.html and the onboarding language buttons). Without adding an es button there, users can’t actually switch to Spanish through the UI even though it’s declared supported here.
|
|
||
| const STORAGE_KEY = "zperiod_lang"; | ||
| const SUPPORTED = ["en", "zh", "zh-Hant", "fr", "ru", "fa", "ur", "tl"]; | ||
| const SUPPORTED = ["en", "zh", "zh-Hant", "fr", "ru", "fa", "ur", "tl", "es"]; |
There was a problem hiding this comment.
The file header comment still lists the supported languages but doesn’t mention Spanish. Since this module now supports es, please update the top-level comment to keep the documentation accurate.
| }, | ||
| "51": { | ||
| "name": "Antimonio", | ||
| "ions": "Sb³⁻ (Antimo niuro), Sb³⁺ (Antimonio(III))", |
There was a problem hiding this comment.
Typo in the ions string: Sb³⁻ (Antimo niuro) has an unintended space that changes the word. This should be a single word (e.g., “Antimoniuro”).
| "ions": "Sb³⁻ (Antimo niuro), Sb³⁺ (Antimonio(III))", | |
| "ions": "Sb³⁻ (Antimoniuro), Sb³⁺ (Antimonio(III))", |
| "Industria del automóvil (convertidores catalíticos para reducción de NOₓ)" | ||
| ], | ||
| "uses": [ | ||
| "Catalizadores con converter (80% de uso)", |
There was a problem hiding this comment.
This Spanish translation string mixes English/Spanish: Catalizadores con converter.... Consider translating fully (e.g., using “convertidor catalítico”) to keep terminology consistent for Spanish users.
| "Catalizadores con converter (80% de uso)", | |
| "Catalizadores con convertidor catalítico (80% de uso)", |
| }, | ||
| { | ||
| "formula": "Na₂CO₃", | ||
| "name": "Soda cáustica" |
There was a problem hiding this comment.
For na_plus, the key compound Na₂CO₃ is labeled “Soda cáustica”, which is typically NaOH. This is likely to confuse students; consider renaming it to “Carbonato de sodio” / “Soda (Na₂CO₃)” to match the formula shown.
| "name": "Soda cáustica" | |
| "name": "Carbonato de sodio" |
| "discoveredBy": "Daniel Rutherford", | ||
| "namedBy": "Griego Nitron (Sosa)", | ||
| "stse": [ | ||
| "LED azул (Premio Nobel)", |
There was a problem hiding this comment.
Encoding/typo issue: LED azул appears to contain mixed-script characters (likely a Cyrillic “у”), which will render incorrectly and can break search/copy. Replace with plain LED azul.
| "LED azул (Premio Nobel)", | |
| "LED azul (Premio Nobel)", |
| "card2Title": "Tutoriales interactivos guiados", | ||
| "card2Body": "Guías interactivas paso a paso añadidas a cada herramienta y página de elemento para ayudarte a dominar los componentes de química al instante.", | ||
| "card3Title": "Soporte de idiomas ampliado", | ||
| "card3Body": "Las páginas, herramientas y contenido técnico principales ahora cuentan con traducciones más completas en los 8 idiomas admitidos.", |
There was a problem hiding this comment.
The changelog text says there are “8 idiomas admitidos”, but this PR adds Spanish (es) to the supported list, making the count 9. Update this string (and the corresponding string in other locales) so the in-app changelog doesn’t become incorrect immediately after adding es.
| "card3Body": "Las páginas, herramientas y contenido técnico principales ahora cuentan con traducciones más completas en los 8 idiomas admitidos.", | |
| "card3Body": "Las páginas, herramientas y contenido técnico principales ahora cuentan con traducciones más completas en los 9 idiomas admitidos.", |
- Fix typo 'Antimo niuro' → 'Antimoniuro' in element 51 - Translate 'converter' to 'convertidor catalítico' in element 45 - Correct Na₂CO₃ label from 'Soda cáustica' to 'Carbonato de sodio' - Replace Cyrillic char in 'LED azul' - Update language count from 8 to 9 in changelog - Add ES to langController header comment - Add Español button to language dropdown in index.html
|
All feedback addressed in 0ac483f — fixed the typos, translated the mixed EN/ES terms, swapped out the sneaky Cyrillic character, corrected the Na₂CO₃ label, bumped the language count to 9, and added the missing Español button to the UI. Thanks for catching these! |
hi, tysm for add Spanish translation for it |
|
Follow-up pushed in 6cc915f: added the missing Español button to the onboarding language selector and aligned the EN/ZH changelog language count to 9 supported languages. |
Hi tysm for the translation help:) |
Adds a complete Spanish (neutral/IUPAC) translation for the Zperiod app.
Files added:
Files modified: