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:
Matthew Taylor 2016-01-06 16:02:46 -05:00
commit f88984f254

View file

@ -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