forked from MapComplete/MapComplete
Add extra check that a feature is added on the right level; automatically add the right level to a new point
This commit is contained in:
parent
038b2ece4c
commit
effd75e95c
8 changed files with 140 additions and 46 deletions
|
@ -317,6 +317,19 @@ export class TypedTranslation<T> extends Translation {
|
|||
return Utils.SubstituteKeys(template, text, lang);
|
||||
}, context)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
PartialSubs<X extends string>(text: Partial<T> & Record<X, string>): TypedTranslation<Omit<T, X>> {
|
||||
const newTranslations : Record<string, string> = {}
|
||||
for (const lang in this.translations) {
|
||||
const template = this.translations[lang]
|
||||
if(lang === "_context"){
|
||||
newTranslations[lang] = template
|
||||
continue
|
||||
}
|
||||
newTranslations[lang] = Utils.SubstituteKeys(template, text, lang)
|
||||
}
|
||||
|
||||
return new TypedTranslation<Omit<T, X>>(newTranslations, this.context)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue