diff --git a/composer.json b/composer.json index 2af4f7b..cd542b6 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "project", "keywords": ["private", "secure", "end-to-end-encrypted", "e2e", "paste", "pastebin", "zero", "zero-knowledge", "encryption", "encrypted", "AES"], "homepage": "https://github.com/PrivateBin", - "license":"zlib", + "license":"zlib-acknowledgement", "support": { "issues": "https://github.com/PrivateBin/PrivateBin/issues", "wiki": "https://github.com/PrivateBin/PrivateBin/wiki", diff --git a/js/privatebin.js b/js/privatebin.js index a39c38a..436a7de 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -441,7 +441,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { // auto-select language based on browser settings if (newLanguage.length === 0) { - newLanguage = (navigator.language || navigator.userLanguage).substring(0, 2); + newLanguage = (navigator.language || navigator.userLanguage || 'en').substring(0, 2); } // if language is already used skip update diff --git a/js/test/I18n.js b/js/test/I18n.js index 0d2fc08..c3a69b2 100644 --- a/js/test/I18n.js +++ b/js/test/I18n.js @@ -99,6 +99,28 @@ describe('I18n', function () { return language === result && language === alias; } ); + + jsc.property( + 'should default to en', + function() { + var clean = jsdom('', {url: 'https://privatebin.net/'}); + + [ 'language', 'userLanguage' ].forEach(function (key) { + Object.defineProperty(navigator, key, { + value: undefined, + writeable: false + }); + }); + + $.PrivateBin.I18n.reset('en'); + $.PrivateBin.I18n.loadTranslations(); + var result = $.PrivateBin.I18n.translate('en'), + alias = $.PrivateBin.I18n._('en'); + + clean(); + return 'en' === result && 'en' === alias; + } + ); }); }); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index f97437b..890d159 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -75,7 +75,7 @@ if ($MARKDOWN): - + @@ -468,17 +468,16 @@ endif;