diff --git a/emhttp/plugins/dynamix/LanguageButton.page b/emhttp/plugins/dynamix/LanguageButton.page index c2cb3f1d8..76f1b41b7 100644 --- a/emhttp/plugins/dynamix/LanguageButton.page +++ b/emhttp/plugins/dynamix/LanguageButton.page @@ -23,13 +23,6 @@ $(function(){$('.nav-item.LanguageButton').hide();}); function LanguageButton() { var locale = ''; - if (locale) { - switchLanguage(''); - $.cookie('locale',locale); - } else { - switchLanguage($.cookie('locale')); - $.removeCookie('locale'); - } // reset dashboard tiles when switching language if (locale != ($.cookie('locale')||'')) { $.removeCookie('db-box1'); @@ -38,6 +31,13 @@ function LanguageButton() { $.removeCookie('inactive_content'); $.removeCookie('hidden_content'); } + if (locale) { + switchLanguage(''); + $.cookie('locale',locale); + } else { + switchLanguage($.cookie('locale')); + $.removeCookie('locale'); + } } function switchLanguage(lang) {