mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
default to pt-br if browser is set to pt
If the user has not yet set their own language, but has pt in their browser, use pt-br for now, to accommodate for our large Brasilian base. Fixes #273.
This commit is contained in:
parent
0e82f99515
commit
0a313ad29b
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