Skip to content

feat(i18n): add complete Spanish (es) translation#2

Open
erbolamm wants to merge 3 commits intoZhilips:mainfrom
erbolamm:feat/spanish-translation
Open

feat(i18n): add complete Spanish (es) translation#2
erbolamm wants to merge 3 commits intoZhilips:mainfrom
erbolamm:feat/spanish-translation

Conversation

@erbolamm
Copy link
Copy Markdown

@erbolamm erbolamm commented Apr 5, 2026

Adds a complete Spanish (neutral/IUPAC) translation for the Zperiod app.

Files added:

  • js/data/locales/ui/es.js — Full UI string translations
  • js/data/locales/es.js — All 118 chemical elements
  • js/data/locales/ions/es.js — All 43 ions (4-level structure)

Files modified:

  • js/data/translations.js
  • js/data/translations_aggregator.js
  • js/modules/langController.js

Copilot AI review requested due to automatic review settings April 5, 2026 19:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 es as 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"];
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

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"];
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment thread js/data/locales/es.js Outdated
},
"51": {
"name": "Antimonio",
"ions": "Sb³⁻ (Antimo niuro), Sb³⁺ (Antimonio(III))",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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”).

Suggested change
"ions": "Sb³⁻ (Antimo niuro), Sb³⁺ (Antimonio(III))",
"ions": "Sb³⁻ (Antimoniuro), Sb³⁺ (Antimonio(III))",

Copilot uses AI. Check for mistakes.
Comment thread js/data/locales/es.js Outdated
"Industria del automóvil (convertidores catalíticos para reducción de NOₓ)"
],
"uses": [
"Catalizadores con converter (80% de uso)",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"Catalizadores con converter (80% de uso)",
"Catalizadores con convertidor catalítico (80% de uso)",

Copilot uses AI. Check for mistakes.
Comment thread js/data/locales/ions/es.js Outdated
},
{
"formula": "Na₂CO₃",
"name": "Soda cáustica"
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"name": "Soda cáustica"
"name": "Carbonato de sodio"

Copilot uses AI. Check for mistakes.
Comment thread js/data/locales/ions/es.js Outdated
"discoveredBy": "Daniel Rutherford",
"namedBy": "Griego Nitron (Sosa)",
"stse": [
"LED azул (Premio Nobel)",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"LED azул (Premio Nobel)",
"LED azul (Premio Nobel)",

Copilot uses AI. Check for mistakes.
Comment thread js/data/locales/ui/es.js Outdated
"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.",
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
"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.",

Copilot uses AI. Check for mistakes.
- 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
@erbolamm
Copy link
Copy Markdown
Author

erbolamm commented Apr 5, 2026

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!

@Zhilips
Copy link
Copy Markdown
Owner

Zhilips commented Apr 14, 2026

Adds a complete Spanish (neutral/IUPAC) translation for the Zperiod app.

Files added:

  • js/data/locales/ui/es.js — Full UI string translations
  • js/data/locales/es.js — All 118 chemical elements
  • js/data/locales/ions/es.js — All 43 ions (4-level structure)

Files modified:

  • js/data/translations.js
  • js/data/translations_aggregator.js
  • js/modules/langController.js

hi, tysm for add Spanish translation for it

@erbolamm
Copy link
Copy Markdown
Author

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.

@Zhilips
Copy link
Copy Markdown
Owner

Zhilips commented Apr 14, 2026

Adds a complete Spanish (neutral/IUPAC) translation for the Zperiod app.

Files added:

  • js/data/locales/ui/es.js — Full UI string translations

  • js/data/locales/es.js — All 118 chemical elements

  • js/data/locales/ions/es.js — All 43 ions (4-level structure)

Files modified:

  • js/data/translations.js

  • js/data/translations_aggregator.js

  • js/modules/langController.js

Hi tysm for the translation help:)

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