From 0a313ad29bb711a3e10a2784a2cad8eb37a6859c Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Mon, 4 Jan 2016 14:18:47 -0500 Subject: [PATCH] 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. --- src/init.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/init.js b/src/init.js index 5418a3b4f..69c40d39a 100644 --- a/src/init.js +++ b/src/init.js @@ -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