diff --git a/LICENSE.md b/LICENSE.md
index 05a4125..8492fc3 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -30,6 +30,16 @@ the following restrictions:
3. This notice may not be removed or altered from any source distribution.
+### MIT license for kjua
+
+Copyright (c) 2016 Lars Jung (https://larsjung.de)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
## GNU General Public License, version 2.0, for SJCL, rawdeflate and rawinflate
_Version 2, June 1991_
diff --git a/js/privatebin.js b/js/privatebin.js
index d6d743c..933c97d 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..10d333a 100644
--- a/js/test/I18n.js
+++ b/js/test/I18n.js
@@ -99,6 +99,30 @@ describe('I18n', function () {
return language === result && language === alias;
}
);
+
+ jsc.property(
+ 'should default to en',
+ function() {
+ var clean = jsdom('', {url: 'https://privatebin.net/'});
+
+ // when navigator.userLanguage is undefined and no default language
+ // is specified, it would throw an error
+ [ '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 7f72530..b197179 100644
--- a/tpl/bootstrap.php
+++ b/tpl/bootstrap.php
@@ -75,7 +75,7 @@ if ($MARKDOWN):
-
+
diff --git a/tpl/page.php b/tpl/page.php
index c3f7ba1..5c54bb7 100644
--- a/tpl/page.php
+++ b/tpl/page.php
@@ -54,7 +54,7 @@ if ($QRCODE):
-
+