mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
Merge pull request #301 from mewtaylor/issue/gh-273-ptbr-default
default to pt-br if browser is set to pt
This commit is contained in:
commit
f88984f254
1 changed files with 3 additions and 0 deletions
|
@ -64,6 +64,9 @@ var translations = require('../locales/translations.json');
|
|||
var obj = jar.get('scratchlanguage');
|
||||
if (typeof obj === 'undefined') {
|
||||
obj = window.navigator.userLanguage || window.navigator.language;
|
||||
if (['pt','pt-pt','PT','PT-PT'].indexOf(obj) !== -1) {
|
||||
obj = 'pt-br'; // default Portuguese users to Brazilian Portuguese due to our user base. Added in 2.2.5.
|
||||
}
|
||||
}
|
||||
if (typeof translations[obj] === 'undefined') {
|
||||
// Fall back on the split
|
||||
|
|
Loading…
Reference in a new issue