Skip to content

Commit

Permalink
reset localization between templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethbruskiewicz committed Dec 22, 2023
1 parent ba13cd7 commit d6f544c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class Toolbar {
// Triggers show/hide of draft templates
$('#view-template-drafts').on('change', () => this.updateTemplateOptions());

$('#select-template-modal').on('change', () => {});

// File -> Upload Template
const $templateInput = $('#upload-template-input');

Expand Down Expand Up @@ -389,10 +391,11 @@ class Toolbar {
.append(language_options)
.select();

$('#select-language-localization').on('click', function () {
$('#select-language-localization').on('change', function () {
const chosenLng = $('#select-language-localization')
.find('option:selected')
.attr('value');
console.log('chagning language', chosenLng);
i18next.changeLanguage(chosenLng);
});

Expand Down Expand Up @@ -489,6 +492,9 @@ class Toolbar {
});

this.hideValidationResultButtons();

// reset language between using templates (localizations are per schema)
i18next.changeLanguage('default');
}

hideValidationResultButtons() {
Expand Down

0 comments on commit d6f544c

Please sign in to comment.