Skip to content

Commit

Permalink
Merge pull request #1304 from diesphink/no_translation_on_locale
Browse files Browse the repository at this point in the history
Option to keep or not the textual translations
  • Loading branch information
gfwilliams authored Feb 11, 2022
2 parents 217fa04 + 58a9b19 commit 32eef1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/locale/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<select id="languages" class="form-select">
</select>
</div>
<div class="form-group">
<input id="translations" type="checkbox" checked /> <label for="translations">Mark this option if you want translations for common text like "Yes", "No", "On", "Off".</label>
</div>
<p>Then click <button id="upload" class="btn btn-primary">Upload</button></p>

<script src="../../core/lib/customize.js"></script>
Expand Down Expand Up @@ -106,12 +109,18 @@
const lang = languageSelector.options[languageSelector.selectedIndex].value;
console.log(`Language ${lang}`);

const translations = document.getElementById('translations').checked;
console.log(`Translations: ${translations}`);

const locale = locales[lang];
if (!locale) {
alert(`Language ${lang} not found!`);
return;
}

if (!translations)
locale.trans = null;

const codePageName = "ISO8859-1";
if (locale.codePage)
codePageName = locale.codePage;
Expand Down

0 comments on commit 32eef1d

Please sign in to comment.