Fix language selection in sandboxed iframes

This commit is contained in:
yflory
2017-09-18 14:26:54 +02:00
parent 0a656ca8d6
commit 1131ef0172
10 changed files with 25 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ var map = {
var getStoredLanguage = function () { return localStorage.getItem(LS_LANG); };
var getBrowserLanguage = function () { return navigator.language || navigator.userLanguage; };
var getLanguage = function () {
if (window.cryptpadLanguage) { return window.cryptpadLanguage; }
if (getStoredLanguage()) { return getStoredLanguage(); }
var l = getBrowserLanguage() || '';
if (Object.keys(map).indexOf(l) !== -1) {