Merge pull request #1304 from diesphink/no_translation_on_locale

Option to keep or not the textual translations
master
Gordon Williams 2022-02-11 11:34:37 +00:00 committed by GitHub
commit 32eef1d713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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>
@ -106,12 +109,18 @@ exports = { name : "en_GB", currencySym:"£",
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;