mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Fixing window.Settings in Localization util
This commit is contained in:
parent
1849431ccd
commit
3e0a600953
1 changed files with 3 additions and 2 deletions
|
@ -15,8 +15,6 @@ let root = '';
|
|||
let localizationMessages = {};
|
||||
|
||||
// Configuration
|
||||
const defaultLocale = window.Settings.defaultLocale;
|
||||
const supportedLocales = window.Settings.supportedLocales;
|
||||
const sampleKeyPrefix = 'key_';
|
||||
|
||||
export default class Localization {
|
||||
|
@ -26,6 +24,9 @@ export default class Localization {
|
|||
// E.g., if we support 'en-US' but not 'en-GB', the user gets 'en-US'
|
||||
// The match in supported locales (or the default locale) is returned.
|
||||
static determineLocaleFromBrowser () {
|
||||
let defaultLocale = window.Settings.defaultLocale;
|
||||
let supportedLocales = window.Settings.supportedLocales;
|
||||
|
||||
var localizationLanguage = window.navigator.userLanguage || window.navigator.language || 'en-us';
|
||||
|
||||
var localizationLanguageParts = localizationLanguage.split('-');
|
||||
|
|
Loading…
Reference in a new issue