Update index.html

This commit is contained in:
zyphlar 2023-01-01 18:39:38 -08:00 committed by GitHub
parent 5f1c4bb58f
commit 907eb15383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,9 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<script type="text/javascript"> <script type="text/javascript">
function loadLocale(){ function loadLocale(){
var sourceUrl = "https://raw.githubusercontent.com/organicmaps/organicmaps/5f7013eb5520d1c849342b0bfac2dd53fa428340/data/sound-strings/"+$("#localeSelect").val()+".json/localize.json"; var commitHash = "b7138ae7f7f7f78da042edc8496d012ad4058334";
var fancyUrl = "https://github.com/organicmaps/organicmaps/blob/5f7013eb5520d1c849342b0bfac2dd53fa428340/data/sound-strings/"+$("#localeSelect").val()+".json/localize.json" var sourceUrl = "https://raw.githubusercontent.com/organicmaps/organicmaps/"+commitHash+"/data/sound-strings/"+$("#localeSelect").val()+".json/localize.json";
var fancyUrl = "https://github.com/organicmaps/organicmaps/blob/"+commitHash+"/data/sound-strings/"+$("#localeSelect").val()+".json/localize.json"
$("#sourceUrl").attr("href", fancyUrl).text($("#localeSelect").val()+".json"); $("#sourceUrl").attr("href", fancyUrl).text($("#localeSelect").val()+".json");
@ -134,9 +135,13 @@
var dir = direction[i % direction.length]; var dir = direction[i % direction.length];
var nextDir = direction[(i + 1) % direction.length]; var nextDir = direction[(i + 1) % direction.length];
var ttsFmt = data['dist_direction_onto_street']; var ttsFmt = data['dist_direction_onto_street'];
var streetDir = data[dir];
if (data[dir+"_street"]) {
streetDir = data[dir+"_street"]; // overwrite the direction string if present for street TTS
}
ttsFmt = ttsFmt.replace("%1$s", data[dist].replace(/[\.。।]/g, "")); // no full stops ttsFmt = ttsFmt.replace("%1$s", data[dist].replace(/[\.。।]/g, "")); // no full stops
ttsFmt = ttsFmt.replace("%2$s", data[dir].replace(/[\.。।]/g, "")); // no full stops ttsFmt = ttsFmt.replace("%2$s", streetDir.replace(/[\.。।]/g, "")); // no full stops
ttsFmt = ttsFmt.replace("%3$s", nextStreets[(i+1) % nextStreets.length]); ttsFmt = ttsFmt.replace("%3$s", nextStreets[(i+1) % nextStreets.length]);
$("#out-e").append(inputPre + ttsFmt + inputPost); $("#out-e").append(inputPre + ttsFmt + inputPost);
@ -146,9 +151,13 @@
var dir = direction[i % direction.length]; var dir = direction[i % direction.length];
var nextDir = direction[(i + 1) % direction.length]; var nextDir = direction[(i + 1) % direction.length];
var ttsFmt = data['dist_direction_onto_street']; var ttsFmt = data['dist_direction_onto_street'];
var streetDir = data[dir];
if (data[dir+"_street"]) {
streetDir = data[dir+"_street"]; // overwrite the direction string if present for street TTS
}
ttsFmt = ttsFmt.replace("%1$s", data[dist].replace(/[\.。।]/g, "")); // no full stops ttsFmt = ttsFmt.replace("%1$s", data[dist].replace(/[\.。।]/g, "")); // no full stops
ttsFmt = ttsFmt.replace("%2$s", data[dir].replace(/[\.。।]/g, "")); // no full stops ttsFmt = ttsFmt.replace("%2$s", streetDir.replace(/[\.。।]/g, "")); // no full stops
ttsFmt = ttsFmt.replace("%3$s", nextStreets[(i+1) % nextStreets.length]); ttsFmt = ttsFmt.replace("%3$s", nextStreets[(i+1) % nextStreets.length]);
$("#out-f").append(inputPre + ttsFmt + " " + data['then'] + " " + data[nextDir] + inputPost); $("#out-f").append(inputPre + ttsFmt + " " + data['then'] + " " + data[nextDir] + inputPost);
@ -239,6 +248,7 @@
</head> </head>
<body style="padding: 1em;"> <body style="padding: 1em;">
<div style="float: right; width: 25%"> <div style="float: right; width: 25%">
<p><b>Review the sample strings and suggest edits as desired. You do not need to edit every single example, only enough to communicate the needed changes.</b></p>
Locale file: Locale file:
<select id="localeSelect" class="form-control"> <select id="localeSelect" class="form-control">
<option value="ar">ﺎﻠﻋﺮﺒﻳﺓ</option> <option value="ar">ﺎﻠﻋﺮﺒﻳﺓ</option>
@ -279,7 +289,7 @@
<option value="vi">Tiếng Việt</option> <option value="vi">Tiếng Việt</option>
<option value="zh-Hans">中文简体</option> <option value="zh-Hans">中文简体</option>
<option value="zh-Hant">中文繁體</option> <option value="zh-Hant">中文繁體</option>
</select><br/><br/> </select><br/>
TTS Voice: <select id="voiceSelect" class="form-control"></select><br/><br/> TTS Voice: <select id="voiceSelect" class="form-control"></select><br/><br/>
<!-- <!--