Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created May 29, 2019 12:45
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 theodesp/6516938f3ebdb1238efc61d929f97391 to your computer and use it in GitHub Desktop.
Save theodesp/6516938f3ebdb1238efc61d929f97391 to your computer and use it in GitHub Desktop.
import {LocaleProvider} from './localeProvider.mjs';
...
const locale = new LocaleProvider(detectLocale());
locale.onChangeLocale((tag)=> console.log('Locale Changed to', tag));
console.log('Detected user locale is', detectLocale());
locale.setCurrent('el');
console.log('Current user locale is', locale.getCurrent());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment