forked from MapComplete/MapComplete
Themes: add various services to hackerspaces and makerspaces, add icons, some fixes to make this work with expandRewrite
This commit is contained in:
parent
d144ae9533
commit
8ceda1cc5f
24 changed files with 731 additions and 42 deletions
|
|
@ -55,12 +55,19 @@ export class ExpandRewrite<T> extends Conversion<T | RewritableConfigJson<T>, T[
|
|||
|
||||
for (const key in obj) {
|
||||
let subtarget = target
|
||||
if (isTr && target[key] !== undefined) {
|
||||
if (isTr) {
|
||||
// The target is a translation AND the current object is a translation
|
||||
// This means we should recursively replace with the translated value
|
||||
subtarget = target[key]
|
||||
if (target[key]) {
|
||||
// A translation is available!
|
||||
subtarget = target[key]
|
||||
} else if (target["en"]) {
|
||||
subtarget = target["en"]
|
||||
} else {
|
||||
// Take the first
|
||||
subtarget = target[Object.keys(target)[0]]
|
||||
}
|
||||
}
|
||||
|
||||
obj[key] = replaceRecursive(obj[key], subtarget)
|
||||
}
|
||||
return obj
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue