mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.4 KiB
35 lines
1.4 KiB
<!DOCTYPE html>
|
|
<title>Localize country names</title>
|
|
<meta charset="utf-8">
|
|
|
|
<script>var svgMap = function () {};</script>
|
|
<script src="../src/js/svgMap/countries.js"></script>
|
|
<script>var svgMapCountries = new svgMap();</script>
|
|
|
|
<div style="padding: 20px 80px; font-family: monospace; font-size: 12px">
|
|
<b>Missing translations</b>
|
|
<div id="missing-countries" style="padding: 15px 0; color: #DD0000"></div>
|
|
<b>Translated countries</b>
|
|
<div style="padding: 15px 0; word-break: break-all; white-space: pre">var svgMapCountryNames = {<div id="data"></div>};</div>
|
|
</div>
|
|
|
|
<script src="./countries.js"></script>
|
|
|
|
<script>
|
|
var missingCountriesOutput = document.getElementById('missing-countries');
|
|
var dataOutput = document.getElementById('data');
|
|
var map = document.getElementById('map');
|
|
var countriesEN = svgMapCountries.countries;
|
|
|
|
Object.keys(countriesEN).forEach(function (countryID, index) {
|
|
if (!countries || !countries[countryID]) {
|
|
var element = document.createElement('div');
|
|
element.innerHTML = countryID + ' | ' + countriesEN[countryID];
|
|
missingCountriesOutput.appendChild(element);
|
|
return;
|
|
}
|
|
var element = document.createElement('div');
|
|
element.innerHTML = ' ' + countryID + ': \'' + countries[countryID] + '\'' + (index + 1 < Object.keys(countriesEN).length ? ',' : '');
|
|
dataOutput.appendChild(element);
|
|
});
|
|
</script>
|