Skip to content

Commit

Permalink
Fixed a bug where the translate widget itself did not propertly update
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoJokhan committed Apr 22, 2024
1 parent c1124ed commit 29c9638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -176,7 +176,7 @@ function addToast(container, typeOfInfoErrorOrSuccess, text, timeout, onClick) {
// If there is a global select, let it handle managing the state of all translation-selects. If not the translation widget has already done its work, just update the other translation widgets
function setSelectedLanguage(language) {
const globalLangSelect = $('#translation-widget-select-global');
if(globalLangSelect) {
if(globalLangSelect.length) {
$('#translation-widget-select-global')
.val(language ? language : 'nl')
.trigger('change');
Expand Down
Expand Up @@ -15,7 +15,9 @@ apos.define('translation-widgets', {
translatedFirstTimeLoadingGlobal = false;
}

if (!$('#translation-widget-select-global')) {
var globalSelect = $('#translation-widget-select-global');

if (!globalSelect.length) {
changeLanguage(e, translationNodesGlobal, traslationNlContentsGlobal);
} else {
setSelectedLanguage(e.target.value);
Expand Down

0 comments on commit 29c9638

Please sign in to comment.