Created
February 11, 2024 08:11
-
-
Save EduardoAC/703da1fe9ed2cfe3e5f019f70db28b7b to your computer and use it in GitHub Desktop.
Example setting up language on the Web App allowing real-time sync with the browser extension
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
function onAuthSuccess(user: User) { | |
// Initialise your client environment after authentication | |
//... | |
setLanguageCookie(user.language) | |
i18n.changeLanguage(user.language) | |
} | |
// ... | |
function onUserLanguageChange(language: LanguagesSupported) { | |
// ... | |
setLanguageCookie(language) | |
i18n.changeLanguage(language) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment