Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to keep or not the textual translations #1304

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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