Option to keep or not the textual translations
parent
3606267aec
commit
4c8c1a6d2f
|
|
@ -10,6 +10,9 @@
|
||||||
<select id="languages" class="form-select">
|
<select id="languages" class="form-select">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<input id="translations" type="checkbox" checked /> <label for="translations">Mark this option if you want translations for commont text like "Yes", "No", "On", "Off".</label>
|
||||||
|
</div>
|
||||||
<p>Then click <button id="upload" class="btn btn-primary">Upload</button></p>
|
<p>Then click <button id="upload" class="btn btn-primary">Upload</button></p>
|
||||||
|
|
||||||
<script src="../../core/lib/customize.js"></script>
|
<script src="../../core/lib/customize.js"></script>
|
||||||
|
|
@ -106,12 +109,18 @@ exports = { name : "en_GB", currencySym:"£",
|
||||||
const lang = languageSelector.options[languageSelector.selectedIndex].value;
|
const lang = languageSelector.options[languageSelector.selectedIndex].value;
|
||||||
console.log(`Language ${lang}`);
|
console.log(`Language ${lang}`);
|
||||||
|
|
||||||
|
const translations = document.getElementById('translations').checked;
|
||||||
|
console.log(`Translations: ${translations}`);
|
||||||
|
|
||||||
const locale = locales[lang];
|
const locale = locales[lang];
|
||||||
if (!locale) {
|
if (!locale) {
|
||||||
alert(`Language ${lang} not found!`);
|
alert(`Language ${lang} not found!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!translations)
|
||||||
|
locale.trans = null;
|
||||||
|
|
||||||
const codePageName = "ISO8859-1";
|
const codePageName = "ISO8859-1";
|
||||||
if (locale.codePage)
|
if (locale.codePage)
|
||||||
codePageName = locale.codePage;
|
codePageName = locale.codePage;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue