Remove cases

This commit is contained in:
Yokayo
2024-05-07 13:11:59 +07:00
parent a02f5ead7e
commit dfa8c6c3d4
4 changed files with 26 additions and 58 deletions

View File

@ -107,12 +107,12 @@ export function applyLocale(root = document) {
const attributeMatch = key.match(/\[(\S+)\](.+)/); // [attribute]key
if (attributeMatch) { // attribute-tagged key
const localizedValue = localeData?.[attributeMatch[2]];
if (localizedValue) {
if (localizedValue || localizedValue == '') {
$(this).attr(attributeMatch[1], localizedValue);
}
} else { // No attribute tag, treat as 'text'
const localizedValue = localeData?.[key];
if (localizedValue) {
if (localizedValue || localizedValue == '') {
$(this).text(localizedValue);
}
}