From 55cbcfc6b22fb787e53d9d5f37f819e663a56eb3 Mon Sep 17 00:00:00 2001 From: Rouven Wessling Date: Fri, 14 Jul 2023 17:10:04 +0200 Subject: [PATCH 1/2] Fix: if the preset language does not exist, no language was selected --- source/javascripts/app/_lang.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/javascripts/app/_lang.js b/source/javascripts/app/_lang.js index cc5ac8b6bd8..abffb1eb520 100644 --- a/source/javascripts/app/_lang.js +++ b/source/javascripts/app/_lang.js @@ -143,7 +143,7 @@ under the License. languages = l; var presetLanguage = getLanguageFromQueryString(); - if (presetLanguage) { + if (presetLanguage && (jQuery.inArray(presetLanguage, languages) != -1)) { // the language is in the URL, so use that language! activateLanguage(presetLanguage); From 629525d5205775e8b10205727dcd9c0d49612cfe Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Wed, 7 Feb 2024 04:15:09 +0000 Subject: [PATCH 2/2] Update _lang.js --- source/javascripts/app/_lang.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/javascripts/app/_lang.js b/source/javascripts/app/_lang.js index abffb1eb520..c1bd6b2a9b0 100644 --- a/source/javascripts/app/_lang.js +++ b/source/javascripts/app/_lang.js @@ -143,7 +143,7 @@ under the License. languages = l; var presetLanguage = getLanguageFromQueryString(); - if (presetLanguage && (jQuery.inArray(presetLanguage, languages) != -1)) { + if (presetLanguage && languages.includes(presetLanguage)) { // the language is in the URL, so use that language! activateLanguage(presetLanguage);