From 39b3af2ae3e5654bec238cf566229d7a9a91f0dc Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 2 Jun 2020 10:42:58 +0200 Subject: [PATCH] Store language settings in the user object --- customize.dist/login.js | 5 +++++ www/common/cryptpad-common.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/customize.dist/login.js b/customize.dist/login.js index 0e46981ea..35121f113 100644 --- a/customize.dist/login.js +++ b/customize.dist/login.js @@ -341,6 +341,11 @@ define([ if (shouldImport) { setMergeAnonDrive(); } + var l = Util.find(rt.proxy, ['settings', 'general', 'language']); + var LS_LANG = "CRYPTPAD_LANG"; + if (l) { + localStorage.setItem(LS_LANG, l); + } return void LocalStore.login(userHash, uname, function () { cb(void 0, res); }); diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 1204e3e27..19faf940b 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -63,7 +63,10 @@ define([ common.setLanguage = function (l, cb) { var LS_LANG = "CRYPTPAD_LANG"; localStorage.setItem(LS_LANG, l); - cb(); + postMessage("SET_ATTRIBUTE", { + attr: ['general', 'language'], + value: l + }, cb); }; common.makeNetwork = function (cb) {