Fix translations
This commit is contained in:
parent
498a515f46
commit
e24b89bba7
1 changed files with 4 additions and 1 deletions
|
@ -48,11 +48,14 @@ export function applyTranslations(language: string) {
|
|||
continue;
|
||||
}
|
||||
|
||||
const splitTranslated = t(dataset.translate!).split("{}");
|
||||
let splitTranslated = t(dataset.translate!).split("{}");
|
||||
if (splitTranslated.length === 1) {
|
||||
node.innerHTML = t(dataset.translate!);
|
||||
continue;
|
||||
}
|
||||
// XXX: this is needed for the strings where the placholder sits at the very
|
||||
// beginning, which introduces phantom empty strings.
|
||||
splitTranslated = splitTranslated.filter((string) => string !== "");
|
||||
|
||||
for (const child of node.childNodes) {
|
||||
if (child.nodeType === Node.TEXT_NODE) {
|
||||
|
|
Reference in a new issue