forked from MapComplete/MapComplete
Fix non-appearing new icon, remove debug outputs
This commit is contained in:
parent
7dfbe5f4b4
commit
90fc0e0840
7 changed files with 15 additions and 13 deletions
6
Utils.ts
6
Utils.ts
|
@ -238,7 +238,7 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
return [a.substr(0, index), a.substr(index + sep.length)];
|
||||
}
|
||||
|
||||
public static SubstituteKeys(txt: string | undefined, tags: any): string | undefined {
|
||||
public static SubstituteKeys(txt: string | undefined, tags: any, useLang?: string): string | undefined {
|
||||
if (txt === undefined) {
|
||||
return undefined
|
||||
}
|
||||
|
@ -258,6 +258,10 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
|
|||
v = date.toISOString()
|
||||
}
|
||||
|
||||
if(useLang !== undefined && v?.translations !== undefined){
|
||||
v = v.translations[useLang] ?? v.translations["*"] ?? (v.textFor !== undefined ? v.textFor(useLang) : v);
|
||||
}
|
||||
|
||||
if(v.InnerConstructElement !== undefined){
|
||||
console.warn("SubstituteKeys received a BaseUIElement to substitute in - this is probably a bug and will be downcast to a string\nThe key is", key,"\nThe value is", v)
|
||||
v = ( <HTMLElement> v.InnerConstructElement())?.innerText
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue