From fa66b79e2ddccf8e2c9719f8b53181ee68bccea7 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 16 Nov 2018 17:13:22 +0900 Subject: [PATCH] Update the locale when version or language changed (#3263) --- src/client/app/boot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/app/boot.js b/src/client/app/boot.js index f3b7304d1..76ea41c64 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -69,11 +69,14 @@ //#endregion let locale = localStorage.getItem('locale'); - if (locale == null) { + const localeKey = localStorage.getItem('localeKey'); + + if (locale == null || localeKey != `${ver}.${lang}`) { const locale = await fetch(`/assets/locales/${lang}.json?ver=${ver}`) .then(response => response.json()); localStorage.setItem('locale', JSON.stringify(locale)); + localStorage.setItem('localeKey', `${ver}.${lang}`); } // Detect the user agent