Skip to content

Instantly share code, notes, and snippets.

@EduardoAC
Created February 11, 2024 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EduardoAC/703da1fe9ed2cfe3e5f019f70db28b7b to your computer and use it in GitHub Desktop.
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
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