feat: add internationalization locale translations#744
Open
EmmyKay0026 wants to merge 2 commits into
Open
Conversation
|
@EmmyKay0026 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Fix the conflict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements full internationalization (i18n) support by adding comprehensive locale translations for the highest-priority target languages. It ensures that all hard-coded strings (specifically within the Settings UI and toast notifications) are extracted and hooked into the translation system so the application can be seamlessly localized.
Type of Change
Related Issue
Closes #676
Changes Made
Settings.tsxand mapped them tot()translation keys, including toast notifications.ar,de,es,fr,ja,ko,zh) that perfectly mirror the structure and keys ofen.json.LanguageSwitcherto persist the active locale tolocalStorageand switch languages dynamically.ar) locale.localeCompleteness.test.ts) to ensure all non-English translation files maintain 100% key parity withen.jsonto prevent future drift.Testing
npm run test:unit)npm run test:integration)Manual test steps (if applicable):
Started frontend dev environment, switched through the 8 available languages in the Settings dropdown. Confirmed
localStorageis updated, the Arabic locale successfully updates<html>todir="rtl", and all strings on the Settings page are fully localized without any fallback to hard-coded text.Migration Changes
npm run migrate:makenpm run migrate:validatedown()function tested locallyDocumentation
README.mdupdated (new commands, endpoints, or setup steps)docs/file updated.env.exampleupdated (new environment variables)backend/docs/API.mdupdated (new or changed endpoints)Checklist
maintype(scope): summary)npm run lint,cargo clippy)npm run build,cargo build --release)console.log/println!left in production code.envfiles committedCI Status
Additional Notes
The completeness tests use a recursive algorithm to flatten nested keys. This means any future developer adding a key to
en.jsonwithout updating the other 7 languages will automatically trigger a CI failure, ensuring localization stays 100% consistent moving forward.