Skip to content
Draft
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions web/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,11 @@ input:checked + .slider:before {
.mapboxgl-ctrl-bottom-right {
position: fixed !important
}

.button-text {
display: inline-block;
}

.button-text:before {
content: "\00a0";
}
32 changes: 32 additions & 0 deletions web/i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
i18next
.use(i18nextHttpBackend)
.init({
lng: 'pl', // default language
fallbackLng: 'pl',
debug: true,
backend: {
loadPath: `./locales${window.location.pathname === '/index.html' ? '/' : window.location.pathname.replace(/\.html$/, '/')}{{lng}}.json`
}
}, function(err, t) {
updateContent();
});

function updateContent() {
document.querySelectorAll('[i18n]').forEach(el => {
const key = el.getAttribute('i18n');
el.innerHTML = i18next.t(key);
});
document.querySelectorAll('[i18n-title]').forEach(el => {
const key = el.getAttribute('i18n-title');
el['title'] = i18next.t(key);
});
}

function updateLanguage(lang) {
i18next.changeLanguage(lang, (err, t) => {
if (err) return console.error(err);
document.documentElement.lang = lang;
document.querySelector('html').setAttribute('lang', lang);
updateContent();
});
}
160 changes: 74 additions & 86 deletions web/index.html

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions web/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"current-language": "English",
"title": "OpenStreetMap Buildings",
"navbar": {
"download-data-for-josm": "Download data for JOSM",
"random-location": "Random Location",
"information-clause": "Information Clause",
"status": "Status",
"faq": "FAQ/Help",
"gis-data": "GIS Data",
"github-link": "GitHub link",
"discord-link": "Discord chat channel link",
"wiki-link": "OpenStreetMap Wiki link",
"localization-link": "Link to this location in OpenStreetMap",
"osm-link-edit-id": "Edit this area in iD",
"osm-link-edit-remote": "Edit this area in external editor (JOSM, Potlatch, Merkaartor)"
},
"modal": {
"download-selected": {
"title": "Download Data",
"alert": "Remember to verify that the objects exist in reality or do not duplicate existing ones in the OSM database before sending data to OSM.",
"select-text": "Select layers to download:",
"download": "Download",
"report-button": "If objects do not exist or are not suitable for import, report them:",
"report-address": "Report only addresses",
"report-building": "Report only buildings",
"report-both": "Report addresses and buildings"
},
"status": {
"title": "Status",
"body": "Status of data loading processes"
},
"budynki": {
"title": "Information Clause",
"bdot10k-title": "Information about the used BDOT10k dataset",
"bdot10k-text": "BDOT10k data is part of the state geodetic and cartographic resource (Article 4(1a)(8) of the Geodetic and Cartographic Law of May 17, 1989 (Journal of Laws of 2020, item 276, as amended). According to Article 40a(2)(1)(h), (j) and Article 40c(5) of the mentioned law, no fees are charged for this data and no licenses are issued. Thus, BDOT10k data can be used for any purpose without restrictions.",
"prg-title": "Information about the used PRG dataset",
"prg-text": "PRG data is part of the state geodetic and cartographic resource (Article 4(1a)(4) of the Geodetic and Cartographic Law of May 17, 1989 (Journal of Laws of 2020, item 276, as amended). According to Article 40a(2)(1)(a) and Article 40c(5) of the mentioned law, no fees are charged for this data and no licenses are issued. Thus, PRG data can be used for any purpose without restrictions."
},
"exclude": {
"title": "Reported",
"body": "Thank you for your report! The object should be removed during the next incremental update.<br>Information about updates can be found in the 'Status' tab."
},
"exclude-fail": {
"title": "Oops..",
"body": "Something went wrong while reporting. Please try again.<br>If the problem persists, report it <a href=\"\"https://github.com/openstreetmap-polska/gugik2osm/issues\" target=\"_blank\" rel=\"noopener\">on GitHub</a>"
}
},
"processes": {
"name": "Name:",
"in-progress": "In progress:",
"yes": "Yes",
"no": "No",
"start-time": "Start time:",
"end-time": "End time:",
"no-of-tiles-to-process": "Tiles remaining to process:",
"last-status": "Last execution status:"
},
"layer-menu": {
"header": "Layers:",
"addresses": "Addresses",
"buildings": "Buildings",
"orto": "Orthophoto (aerial images)",
"updates": "OSM updates and data exports"
},
"bottom-alert": {
"hosting": "Hosting thanks to: ",
"info-text": "The site is not being developed/maintained and requires a complete rewrite."
},
"close": "Close"
}
3 changes: 3 additions & 0 deletions web/locales/maintenance/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"in-progress": "Maintenance work in progress..."
}
3 changes: 3 additions & 0 deletions web/locales/maintenance/pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"in-progress": "Prace konserwacyjne w trakcie..."
}
71 changes: 71 additions & 0 deletions web/locales/pl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"current-language": "Polski",
"title": "Budynki OpenStreetMap",
"navbar": {
"download-data-for-josm": "Pobierz dane dla JOSM",
"random-location": "Losuj lokalizację",
"information-clause": "Klauzula informacyjna",
"status": "Status",
"faq": "FAQ/Pomoc",
"gis-data": "Dane GIS",
"github-link": "Link do GitHub",
"discord-link": "Link do kanału na czacie Discord",
"wiki-link": "Link do Wiki OpenStreetMap",
"localization-link": "Link do tej lokalizacji w OpenStreetMap",
"osm-link-edit-id": "Edytuj ten obszar w iD",
"osm-link-edit-remote": "Edytuj ten obszar w zewnętrznym edytorze (JOSM, Potlatch, Merkaartor)"
},
"modal": {
"download-selected": {
"title": "Pobieranie danych",
"alert": "Pamiętaj, aby przed wysłaniem danych do OSM zweryfikować czy obiekty istnieją w rzeczywistości albo, czy nie dublują już istniejących w bazie OSM.",
"select-title": "Wybierz warstwy do pobrania:",
"download": "Pobierz",
"report-button": "Jeżeli obiekty nie istnieją lub nie nadają się do importu zgłoś je:",
"report-address": "Zgłoś tylko adresy",
"report-building": "Zgłoś tylko budynki",
"report-both": "Zgłoś adresy i budynki"
},
"status": {
"title": "Status",
"body": "Status procesów ładowania danych"
},
"budynki": {
"title": "Klauzula informacyjna",
"bdot10k-title":"Informacja o wykorzystanym zbiorze BDOT10k",
"bdot10k-text": "Dane BDOT10k są elementem państwowego zasobu geodezyjnego i kartograficznego (art. 4 ust. 1a pkt 8 ustawy z dnia 17 maja 1989 r. Prawo geodezyjne i kartograficzne (Dz. U. z 2020 r. poz. 276 z późn. zm.). Zgodnie natomiast z art. 40a ust. 2 pkt 1 lit. h, j oraz 40c ust. 5 wymienionej ustawy nie pobiera się za te dane opłat i nie wydaje licencji. Tym samym dane BDOT10k mogą być wykorzystywane do dowolnego celu bez ograniczeń.",
"prg-title": "Informacja o wykorzystanym zbiorze PRG",
"prg-text": "Dane PRG są elementem państwowego zasobu geodezyjnego i kartograficznego (art. 4 ust. 1a pkt 4 ustawy z dnia 17 maja 1989 r. Prawo geodezyjne i kartograficzne (Dz. U. z 2020 r. poz. 276 z późn. zm.). Zgodnie natomiast z art. 40a ust. 2 pkt 1 lit. a oraz 40c ust. 5 wymienionej ustawy nie pobiera się za te dane opłat i nie wydaje licencji. Tym samym dane PRG mogą być wykorzystywane do dowolnego celu bez ograniczeń."
},
"exclude": {
"title": "Zgłoszono",
"body": "Dziękujemy za zgłoszenie! Podczas kolejnej aktualizacji cominutowej obiekt powinien zostać usunięty.<br>Informacje o aktualizacjach są w zakładce \"Status\"."
},
"exclude-fail": {
"title": "Ups..",
"body": "Coś poszło nie tak podczas zgłaszania. Spróbuj jeszcze raz.<br>Jeżeli problem będzie się powtarzać zgłoś go <a href=\"https://github.com/openstreetmap-polska/gugik2osm/issues\" target=\"_blank\" rel=\"noopener\">na GitHubie</a>"
}
},
"processes": {
"name": "Nazwa:",
"in-progress": "Czy w trakcie:",
"yes": "Tak",
"no": "Nie",
"start-time": "Czas rozpoczęcia:",
"end-time": "Czas zakończenia:",
"no-of-tiles-to-process": "Kafle pozostałe do przetworzenia:",
"last-status": "Status ostatniego wykonania:"
},
"layer-menu": {
"header": "Warstwy:",
"addresses": "Adresy",
"buildings": "Budynki",
"orto": "Ortofotomapa (zdj. lotnicze)",
"updates": "Aktualizacje OSM i eksporty danych"
},
"bottom-alert": {
"hosting": "Hosting dzięki: ",
"info-text": "Strona nie jest rozwijana/naprawiana i wymaga przepisania od nowa."
},
"close": "Zamknij"
}
8 changes: 6 additions & 2 deletions web/maintenance.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!DOCTYPE html>
<html>
<html lang="pl">
<head>
<!-- Add internationalization -->
<script src="https://unpkg.com/i18next@16.0.0/dist/umd/i18next.js"></script>
<script src="https://unpkg.com/i18next-http-backend@2.2.1/i18nextHttpBackend.min.js"></script>
</head>
<body>
<center><strong>Prace konserwacyjne w trakcie...</strong></center>
<center><strong i18n="in-progress"></strong></center>
<script src="./i18n.js"></script>
</body>
</html>
17 changes: 9 additions & 8 deletions web/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ function processesInfo () {
console.log(data);
var temp = '<table>';
data.processes.forEach((el) => {
temp += `<tr><td><b>Nazwa:</b></td><td><b>${el.name}</b></td>`;
temp += `<tr><td><b i18n="processes.name"></b></td><td><b>${el.name}</b></td>`;
if (el.in_progress) {
temp += `<tr><td>Czy w trakcie:</td><td style="background-color: #66ff33;">Tak</td>`;
temp += `<tr><td i18n="processes.in-progress"></td><td style="background-color: #66ff33;" i18n="processes.yes"></td>`;
} else {
temp += `<tr><td>Czy w trakcie:</td><td>Nie</td>`;
temp += `<tr><td i18n="processes.in-progress"></td><td i18n="processes.yes"></td>`;
}
temp += `<tr><td>Czas rozpoczęcia:</td><td>${el.start_time}</td>`;
temp += `<tr><td i18n="processes.start-time"></td><td>${el.start_time}</td>`;
if (el.end_time != null) {
temp += `<tr><td>Czas zakończenia:</td><td>${el.end_time}</td>`;
temp += `<tr><td i18n="processes.end-time"></td><td>${el.end_time}</td>`;
}
if (el.no_of_tiles_to_process != null && el.no_of_tiles_to_process >= 0) {
temp += `<tr><td>Kafle pozostałe do przetworzenia:</td><td>${el.no_of_tiles_to_process}</td>`;
temp += `<tr><td i18n="processes.no-of-tiles-to-process"></td><td>${el.no_of_tiles_to_process}</td>`;
}
if (el.last_status != null) {
temp += `<tr><td>Status ostatniego wykonania:</td><td>${el.last_status}</td>`;
temp += `<tr><td i18n="processes.last-status"></td><td>${el.last_status}</td>`;
}
});
temp += '</table>';
$('#procinfo').html(temp);
updateContent();
});
}
}
Loading