fix: workaround for startinblox-feature-requests#250

This commit is contained in:
Jean-Baptiste Pasquier
2021-04-08 12:25:26 +02:00
parent 9a747b6ab5
commit 68587dc94e
5 changed files with 16 additions and 4 deletions

View File

@ -78,6 +78,17 @@ class JsI18n {
this.translateNodeContent(label, k);
}
}
// https://git.startinblox.com/framework/sib-core/issues/755
if (attr.startsWith('placeholder-')) {
let placeholder = node.querySelector('[placeholder="' + attr.replace("placeholder-", "") + '"]');
if (placeholder != null) {
this.translateNodeContent(placeholder.attributes['placeholder'], k);
let input = node.querySelector('[name="' + attr.replace("placeholder-", "") + '"] > input');
if(input != null) {
this.translateNodeContent(input.attributes['placeholder'], k);
}
}
}
this.translateNodeContent(node.attributes[attr], k);
}
}