Skip to content

Comments

feat: improve internationalization (i18n) workflows, user interface messages, and profile field handling#6

Merged
bra-i-am merged 6 commits intomainfrom
main.v2
Jan 27, 2026
Merged

feat: improve internationalization (i18n) workflows, user interface messages, and profile field handling#6
bra-i-am merged 6 commits intomainfrom
main.v2

Conversation

@bra-i-am
Copy link
Collaborator

This pull request introduces several improvements related to internationalization (i18n) workflows, user interface messages, and profile field handling. The most significant changes add new Makefile targets and scripts to support translation extraction and validation, update UI text to use i18n messages, and improve handling of language preference changes.

Internationalization workflow improvements:

  • Added Makefile targets and variables for extracting, concatenating, and validating translation files, including extract_translations, i18n.extract, i18n.concat, and translation change detection. These streamline the process of managing translations and ensure consistency with CI requirements. [1] [2]
  • Added an i18n_extract npm script to run message extraction using fedx-scripts formatjs extract.
  • Added an empty default export in src/i18n/index.js and updated the package export to include messages for i18n support. [1] [2]

User interface and i18n message updates:

  • Updated the "Add" button label in BaseField.jsx to use a translatable message with the field label as a parameter, and added the corresponding message definition in messages.jsx. [1] [2]

Profile field and language preference handling:

  • Improved profile field save logic in AccountFields to handle errors gracefully and reset the form edition state after save attempts. [1] [2]
  • Added logic in ExtendedProfileFields to reload the page when the user's language preference changes, ensuring the UI updates to the new language. [1] [2]

- Implemented language preference detection in ExtendedProfileFields component using `getLocale` from `@edx/frontend-platform/i18n`.
- Added a reload mechanism to refresh the page when the language preference changes.
- Introduced new message for adding field values in messages.js.
- Updated index.js to export messages for internationalization.
- Created a new i18n module to manage localization.
- Added `i18n_extract` script to package.json for extracting translation strings.
@bra-i-am bra-i-am merged commit 65610ec into main Jan 27, 2026
2 of 3 checks passed
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