forked from MapComplete/MapComplete
Huge refactorings of JSON-parsing and Tagsfilter, other cleanups, warning cleanups and lots of small subtle bugfixes
This commit is contained in:
parent
9a5b35b9f3
commit
a57b7d93fa
113 changed files with 1565 additions and 2594 deletions
|
@ -1,7 +1,5 @@
|
|||
import {UIElement} from "../UIElement"
|
||||
import Locale from "./Locale"
|
||||
import {FixedUiElement} from "../Base/FixedUiElement";
|
||||
import {TagUtils} from "../../Logic/TagsFilter";
|
||||
import Combine from "../Base/Combine";
|
||||
|
||||
|
||||
|
@ -17,6 +15,9 @@ export default class Translation extends UIElement {
|
|||
const combined = [];
|
||||
const parts = template.split("{" + k + "}");
|
||||
const el: string | UIElement = text[k];
|
||||
if(el === undefined){
|
||||
continue;
|
||||
}
|
||||
let rtext: string = "";
|
||||
if (typeof (el) === "string") {
|
||||
rtext = el;
|
||||
|
@ -51,6 +52,7 @@ export default class Translation extends UIElement {
|
|||
for (const i in this.translations) {
|
||||
return this.translations[i]; // Return a random language
|
||||
}
|
||||
console.log("Missing language ",Locale.language.data,"for",this.translations)
|
||||
return "Missing translation"
|
||||
}
|
||||
|
||||
|
@ -62,6 +64,10 @@ export default class Translation extends UIElement {
|
|||
|
||||
constructor(translations: object) {
|
||||
super(Locale.language)
|
||||
let count = 0;
|
||||
for (const translationsKey in translations) {
|
||||
count++;
|
||||
}
|
||||
this.translations = translations
|
||||
}
|
||||
|
||||
|
|
|
@ -128,19 +128,16 @@ export default class Translations {
|
|||
question: new T({
|
||||
en: 'Is this parking covered? Also select "covered" for indoor parkings.',
|
||||
nl: 'Is deze parking overdekt? Selecteer ook "overdekt" voor fietsparkings binnen een gebouw.',
|
||||
fr: 'TODO: fr',
|
||||
gl: 'Este aparcadoiro está cuberto? Tamén escolle "cuberto" para aparcadoiros interiores.'
|
||||
}),
|
||||
yes: new T({
|
||||
en: 'This parking is covered (it has a roof)',
|
||||
nl: 'Deze parking is overdekt (er is een afdak)',
|
||||
fr: 'TODO: fr',
|
||||
gl: 'Este aparcadoiro está cuberto (ten un teito)'
|
||||
}),
|
||||
no: new T({
|
||||
en: 'This parking is not covered',
|
||||
nl: 'Deze parking is niet overdekt',
|
||||
fr: 'TODO: fr',
|
||||
gl: 'Este aparcadoiro non está cuberto'
|
||||
})
|
||||
},
|
||||
|
@ -148,19 +145,16 @@ export default class Translations {
|
|||
question: new T({
|
||||
en: "How many bicycles fit in this bicycle parking (including possible cargo bicycles)?",
|
||||
nl: "Voor hoeveel fietsen is er bij deze fietsparking plaats (inclusief potentiëel bakfietsen)?",
|
||||
fr: "TODO: fr",
|
||||
gl: "Cantas bicicletas caben neste aparcadoiro de bicicletas (incluídas as posíbeis bicicletas de carga)?"
|
||||
}),
|
||||
template: new T({
|
||||
en: "This parking fits $nat$ bikes",
|
||||
nl: "Deze parking heeft plaats voor $nat$ fietsen",
|
||||
fr: "TODO: fr",
|
||||
gl: "Neste aparcadoiro caben $nat$ bicicletas"
|
||||
}),
|
||||
render: new T({
|
||||
en: "Place for {capacity} bikes (in total)",
|
||||
nl: "Plaats voor {capacity} fietsen (in totaal)",
|
||||
fr: "TODO: fr",
|
||||
gl: "Lugar para {capacity} bicicletas (en total)"
|
||||
}),
|
||||
},
|
||||
|
@ -1308,6 +1302,18 @@ export default class Translations {
|
|||
en: "Enable the 'geolocate-me' button (mobile only)",
|
||||
gl: "Activar o botón de 'xeolocalizarme' (só móbil)",
|
||||
nl: "Toon het knopje voor geolocalisatie (enkel op mobiel)"
|
||||
}),
|
||||
fsIncludeCurrentBackgroundMap: new T({
|
||||
en: "Include the current background choice <b>{name}</b>",
|
||||
nl: "Gebruik de huidige achtergrond <b>{name}</b>"
|
||||
}),
|
||||
fsIncludeCurrentLayers: new T({
|
||||
en: "Include the current layer choices",
|
||||
nl: "Toon enkel de huidig getoonde lagen"
|
||||
}),
|
||||
fsIncludeCurrentLocation: new T({
|
||||
en: "Include current location",
|
||||
nl: "Start op de huidige locatie"
|
||||
})
|
||||
},
|
||||
morescreen: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue