-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(): add translations to plugin and popup redesign
- Loading branch information
Showing
9 changed files
with
542 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
function getUILanguage() { | ||
let userLanguage = ''; | ||
|
||
if (typeof browser !== 'undefined' && browser.i18n) { | ||
// For Firefox or compatible browsers | ||
userLanguage = browser.i18n.getUILanguage(); | ||
} else if (typeof chrome !== 'undefined' && chrome.i18n) { | ||
// For Chrome or compatible browsers | ||
userLanguage = chrome.i18n.getUILanguage(); | ||
} else if (typeof navigator !== 'undefined' && navigator.language) { | ||
// Fallback to using navigator.language | ||
userLanguage = navigator.language; | ||
} | ||
|
||
return userLanguage; | ||
} | ||
|
||
export const i18n = { | ||
getUILanguage, | ||
}; |
Oops, something went wrong.