mirror of
https://github.com/zyphlar/organicmaps-locale-viewer.git
synced 2024-03-08 13:27:46 +00:00
fix arabic
This commit is contained in:
parent
92e48f4ab7
commit
4b9673e05a
19
index.html
19
index.html
|
@ -43,7 +43,7 @@
|
||||||
<body style="padding: 1em;">
|
<body style="padding: 1em;">
|
||||||
<div style="position: fixed; top: 0; right: 0; width: 30%; z-index: 999; background: white; border: 1px solid gray; padding: 1em;">
|
<div style="position: fixed; top: 0; right: 0; width: 30%; z-index: 999; background: white; border: 1px solid gray; padding: 1em;">
|
||||||
<h5>Organic Maps Locale File Viewer</h5>
|
<h5>Organic Maps Locale File Viewer</h5>
|
||||||
<p>Don't worry about adding or removing periods like <span class="badge bg-secondary">.</span> <span class="badge bg-secondary">。</span>(Japanese) or <span class="badge bg-secondary">।</span>(Hindi) at the end of strings. They will not affect the TTS speech either way.</p>
|
<p>Don't worry about adding or removing periods like <span class="badge bg-secondary">.</span> <span class="badge bg-secondary">。</span>(Japanese) or <span class="badge bg-secondary">।</span>(Hindi) at the end of strings. They will not affect the TTS speech either way.<br/>You may hover over phrases to see their English version in a popup. Right-to-left languages may not be displayed correctly.</p>
|
||||||
<h6>Locale language:</h6>
|
<h6>Locale language:</h6>
|
||||||
<select id="localeSelect" class="form-control">
|
<select id="localeSelect" class="form-control">
|
||||||
<option value="ar">ﺎﻠﻋﺮﺒﻳﺓ</option>
|
<option value="ar">ﺎﻠﻋﺮﺒﻳﺓ</option>
|
||||||
|
@ -255,9 +255,17 @@
|
||||||
} else if (value.length < 10) {
|
} else if (value.length < 10) {
|
||||||
classes += " narrow";
|
classes += " narrow";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var english = "";
|
||||||
|
var englishVersion = window.originalEnglishData[key];
|
||||||
|
if (englishVersion) {
|
||||||
|
english = "en: "+englishVersion;
|
||||||
|
}
|
||||||
|
|
||||||
var out = "<span class='tranString badge "+color+"'><input type='text' class='"+classes+"' readonly data-key='"+
|
var out = "<span class='tranString badge "+color+"'><input type='text' class='"+classes+"' readonly data-key='"+
|
||||||
key +
|
key +
|
||||||
|
"' title='" +
|
||||||
|
english +
|
||||||
"' value='" +
|
"' value='" +
|
||||||
value +
|
value +
|
||||||
"'>";
|
"'>";
|
||||||
|
@ -273,7 +281,10 @@
|
||||||
|
|
||||||
function buildFmtStringInput(key, value, color="text-bg-primary", fmtKey, editable=true) {
|
function buildFmtStringInput(key, value, color="text-bg-primary", fmtKey, editable=true) {
|
||||||
var classes = "stringTxt";
|
var classes = "stringTxt";
|
||||||
console.log(fmtKey);
|
|
||||||
|
// replace RTL chars with their HTML equivalent
|
||||||
|
value = value.replace("\\u202C", "‬");
|
||||||
|
|
||||||
var out = "<span class='tranString badge "+color+"'><span type='text' class='"+classes+"' readonly data-key='"+
|
var out = "<span class='tranString badge "+color+"'><span type='text' class='"+classes+"' readonly data-key='"+
|
||||||
key +
|
key +
|
||||||
"' data-fmtkey='" +
|
"' data-fmtkey='" +
|
||||||
|
@ -377,7 +388,6 @@
|
||||||
var string = strings[i];
|
var string = strings[i];
|
||||||
// remove preceding periods from TTS text
|
// remove preceding periods from TTS text
|
||||||
if (myText.endsWith(".") || myText.endsWith("。") || myText.endsWith("।")) {
|
if (myText.endsWith(".") || myText.endsWith("。") || myText.endsWith("।")) {
|
||||||
console.log("replacing");
|
|
||||||
myText = myText.slice(0, -1);
|
myText = myText.slice(0, -1);
|
||||||
}
|
}
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
|
@ -404,6 +414,7 @@
|
||||||
function showData(){
|
function showData(){
|
||||||
var locale = $("#localeSelect").val();
|
var locale = $("#localeSelect").val();
|
||||||
var data = parseSoundTxt(window.soundTxtRaw)[locale];
|
var data = parseSoundTxt(window.soundTxtRaw)[locale];
|
||||||
|
window.originalEnglishData = parseSoundTxt(window.soundTxtRaw)['en'];
|
||||||
|
|
||||||
window.originalSoundData = data;
|
window.originalSoundData = data;
|
||||||
window.modifiedSoundData = Object.assign({}, data); // clone
|
window.modifiedSoundData = Object.assign({}, data); // clone
|
||||||
|
|
Loading…
Reference in New Issue
Block a user