Skip to content

Fix: Detect browser language and use for Translate plugin 'To' language#1461

Open
antcybersec wants to merge 2 commits intointernetarchive:masterfrom
antcybersec:master
Open

Fix: Detect browser language and use for Translate plugin 'To' language#1461
antcybersec wants to merge 2 commits intointernetarchive:masterfrom
antcybersec:master

Conversation

@antcybersec
Copy link

  • Detect browser language using navigator.language
  • Convert to ISO6391 format using toISO6391 utility
  • Check if browser language is available in translation models
  • Set browser language as default 'To' language if available, otherwise fallback to English
  • Fixes issue Detect browser language and use for Translate plugin "To" language #1459
    here is the screenshot of the fix:
translate

- Detect browser language using navigator.language
- Convert to ISO6391 format using toISO6391 utility
- Check if browser language is available in translation models
- Set browser language as default 'To' language if available, otherwise fallback to English
- Fixes issue internetarchive#1459
- Removed unnecessary whitespace in the language detection logic
- Improved code readability without altering functionality
Copy link
Author

@antcybersec antcybersec left a comment

Choose a reason for hiding this comment

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

hey @cdrini can you check the PR once again?

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.

2 participants