forked from MapComplete/MapComplete
Small cleanups
This commit is contained in:
parent
3f70892d75
commit
028767afe6
3 changed files with 7 additions and 5 deletions
|
@ -217,9 +217,14 @@ export class Translation extends BaseUIElement {
|
|||
|
||||
static fromMap(transl: Map<string, string>) {
|
||||
const translations = {}
|
||||
let hasTranslation = false;
|
||||
transl?.forEach((value, key) => {
|
||||
translations[key] = value
|
||||
hasTranslation = true
|
||||
})
|
||||
if(!hasTranslation){
|
||||
return undefined
|
||||
}
|
||||
return new Translation(translations);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue