Skip to content

chore: add Español - es-ES language support #533

Open
SherlynS wants to merge 1 commit into
asgardeo:mainfrom
SherlynS:sherlynS-add-spa
Open

chore: add Español - es-ES language support #533
SherlynS wants to merge 1 commit into
asgardeo:mainfrom
SherlynS:sherlynS-add-spa

Conversation

@SherlynS

@SherlynS SherlynS commented Jun 29, 2026

Copy link
Copy Markdown

Purpose

Previously, the Asgardeo JavaScript SDK did not have support for Spanish (Español - es-ES). Users who prefered Spanish would not have been able see UI components translated, limiting accessibility for Spanish-speaking users.

This PR addresses this barrier and now customers who prefer Spanish will be able to see UI components translated and easily navigate through other UI components for each readability and use.

Related PRs/Issues

Changes

  • Added new es-ES.ts file for Spanish translation
  • Added to index.ts the export value to make Spanish translations importable across SDK
  • Added spanish-translation-bundle.md changeset to trigger a minor @asgardeo/i18n version bump
  • Modified CONTRIBUTING.md doc to showcase documentation caveats encountered in building and testing.

Testing

  • Followed option 2: testing with sample in order to verify changes

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. - updated exiting documentation
  • no unit tests - only sample testing

Security checks

Summary by CodeRabbit

  • New Features

    • Added Spanish (es-ES) translation support to the app’s internationalization bundle, improving the experience for Spanish-speaking users.
  • Documentation

    • Updated translation testing and sample app setup instructions.
    • Clarified how to rebuild and verify locale changes locally, including environment setup and expected translation behavior.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new Spanish (es-ES) translation bundle to the i18n package, exports it from the translations index, updates CONTRIBUTING.md testing instructions, and includes a changeset declaring a minor version bump for @asgardeo/i18n.

Changes

Spanish translation bundle addition

Layer / File(s) Summary
es-ES translation bundle and export wiring
packages/i18n/src/translations/es-ES.ts, packages/i18n/src/translations/index.ts
New Spanish translations module with strings for buttons, forms, validations, sign-in/sign-up widgets, profile UI, and error messages, plus locale metadata; default-exported as es_ES and re-exported from the translations index alongside reformatted existing exports.
Contributor testing docs and changeset
CONTRIBUTING.md, .changeset/spanish-translation-bundle.md
Updated translation testing instructions to use Nx build commands, clarified sample integration via workspace:*, added .env.local setup guidance and notes on server-driven vs bundle-driven text, and added a changeset for the minor release.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Spanish es-ES language support.
Description check ✅ Passed The description covers purpose, related work, changes, testing, checklist, and security, matching the template's intent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Add es-ES translation bundle, register it in the translations index,
add a changeset, and document build/testing caveats in CONTRIBUTING.md.
@SherlynS SherlynS force-pushed the sherlynS-add-spa branch from 24b120a to 2aac90d Compare July 3, 2026 01:56
@SherlynS SherlynS marked this pull request as ready for review July 8, 2026 01:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/i18n/src/translations/es-ES.ts`:
- Line 59: The Spanish translation in es-ES still uses the English label for the
elements.fields.email.label key, causing mixed-language UI text. Update the
translation entry in the es-ES locale file to a Spanish label such as “Correo
electrónico”, keeping the same key so the translations lookup continues to work
correctly.

In `@packages/i18n/src/translations/index.ts`:
- Around line 19-27: `es_ES` is exported from the translations index but not
loaded by the default bundle list, so add `es-ES` to
`TranslationBundleConstants.DEFAULT_LOCALES` and ensure
`getDefaultI18nBundles()` picks it up alongside the existing default locale(s).
Use the existing `es_ES` export in `translations/index.ts` and the
`DEFAULT_LOCALES` constant in `TranslationBundleConstants` to keep the runtime
defaults aligned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62aaca51-495f-4985-abf9-a98a75ee5607

📥 Commits

Reviewing files that changed from the base of the PR and between 24c36b4 and 2aac90d.

📒 Files selected for processing (4)
  • .changeset/spanish-translation-bundle.md
  • CONTRIBUTING.md
  • packages/i18n/src/translations/es-ES.ts
  • packages/i18n/src/translations/index.ts

'elements.fields.first_name.placeholder': 'Ingresa tu nombre',
'elements.fields.last_name.label': 'Apellido',
'elements.fields.last_name.placeholder': 'Ingresa tu apellido',
'elements.fields.email.label': 'Email',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Translate the email field label.

This key still renders English text in the Spanish locale, so forms will show a mixed-language label. Change it to a Spanish label such as Correo electrónico.

Suggested fix
-  'elements.fields.email.label': 'Email',
+  'elements.fields.email.label': 'Correo electrónico',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'elements.fields.email.label': 'Email',
'elements.fields.email.label': 'Correo electrónico',
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/i18n/src/translations/es-ES.ts` at line 59, The Spanish translation
in es-ES still uses the English label for the elements.fields.email.label key,
causing mixed-language UI text. Update the translation entry in the es-ES locale
file to a Spanish label such as “Correo electrónico”, keeping the same key so
the translations lookup continues to work correctly.

Comment on lines +19 to +27
export { default as es_ES } from './es-ES';
export { default as en_US } from './en-US';
export { default as fr_FR } from './fr-FR';
export { default as te_IN } from './te-IN';
export { default as hi_IN } from './hi-IN';
export { default as pt_BR } from './pt-BR';
export { default as pt_PT } from './pt-PT';
export { default as ta_IN } from './ta-IN';
export { default as si_LK } from './si-LK';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n "DEFAULT_LOCALES|es-ES|es_ES" \
  packages/i18n/src/constants/TranslationBundleConstants.ts \
  packages/i18n/src/translations/index.ts \
  packages/i18n/src/utils/getDefaultI18nBundles.ts

Repository: asgardeo/javascript

Length of output: 698


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n--- packages/i18n/src/constants/TranslationBundleConstants.ts ---\n'
sed -n '1,120p' packages/i18n/src/constants/TranslationBundleConstants.ts

printf '\n--- packages/i18n/src/utils/getDefaultI18nBundles.ts ---\n'
sed -n '1,140p' packages/i18n/src/utils/getDefaultI18nBundles.ts

printf '\n--- packages/i18n/src/translations/index.ts ---\n'
sed -n '1,80p' packages/i18n/src/translations/index.ts

Repository: asgardeo/javascript

Length of output: 4696


Add es-ES to TranslationBundleConstants.DEFAULT_LOCALES
packages/i18n/src/translations/index.ts exports es_ES, but getDefaultI18nBundles() only loads locales listed in TranslationBundleConstants.DEFAULT_LOCALES (currently just en-US), so es-ES won’t be included in the runtime defaults.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/i18n/src/translations/index.ts` around lines 19 - 27, `es_ES` is
exported from the translations index but not loaded by the default bundle list,
so add `es-ES` to `TranslationBundleConstants.DEFAULT_LOCALES` and ensure
`getDefaultI18nBundles()` picks it up alongside the existing default locale(s).
Use the existing `es_ES` export in `translations/index.ts` and the
`DEFAULT_LOCALES` constant in `TranslationBundleConstants` to keep the runtime
defaults aligned.

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