Skip to content

Refactor: Automate page reload on language change#7512

Open
lavjeetrai wants to merge 1 commit into
sugarlabs:masterfrom
lavjeetrai:lang
Open

Refactor: Automate page reload on language change#7512
lavjeetrai wants to merge 1 commit into
sugarlabs:masterfrom
lavjeetrai:lang

Conversation

@lavjeetrai

@lavjeetrai lavjeetrai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description:
Improved the user experience by automatically reloading the page when the user changes their language preference. Previously, the application would display a toast message asking the user to manually refresh their browser.

Changes:

  • js/languagebox.js: Replaced the manual refresh prompt (this.activity.textMsg) with an automatic this.reload() call when the language is updated. Cleaned up the unused MSG translation dictionary and obsolete DOM event listeners.
  • js/__tests__/languagebox.test.js: Updated test assertions to check for reload() being called instead of checking for text prompts. Safely removed obsolete tests related to the deleted manual refresh link.

Testing:

  • Verified that changing the language now triggers an automatic reload.
  • Full test suite (npm test) passes successfully with proper global code coverage.

Category.

  • Performance

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Jest Test Results

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 48.35% | Branches: 40.04% | Functions: 53.05% | Lines: 48.74%
Master Coverage: Statements: 48.36% | Branches: 40.06% | Functions: 53.05% | Lines: 48.75%

@github-actions github-actions Bot added performance Improves performance (load time, memory, rendering) size/M Medium: 50-249 lines changed area/javascript Changes to JS source files area/tests Changes to test files labels Jun 12, 2026
@lavjeetrai

Copy link
Copy Markdown
Contributor Author

I would love any feedback on this implementation.

@Ashutoshx7

Copy link
Copy Markdown
Collaborator

can u address the dead japanese-split code in hide() ( delete it or just move it before the storage write to fix the long standing asymmetry )

@walterbender your thoughts on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/javascript Changes to JS source files area/tests Changes to test files performance Improves performance (load time, memory, rendering) size/M Medium: 50-249 lines changed

Projects

Development

Successfully merging this pull request may close these issues.

2 participants