fix: add type check for undefined, use fallback when no translation for aspect ratios was given (#3025)

This commit is contained in:
Manuel Schmid 2024-05-28 00:09:39 +02:00 committed by GitHub
parent dfff9b7dcf
commit 0e621ae34e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -81,9 +81,12 @@ function refresh_style_localization() {
}
function refresh_aspect_ratios_label(value) {
label = document.querySelector('#aspect_ratios_accordion div span[data-original-text="Aspect Ratios"]')
translation = getTranslation("Aspect Ratios")
label.textContent = translation + " " + htmlDecode(value)
label = document.querySelector('#aspect_ratios_accordion div span[data-original-text="Aspect Ratios"]');
translation = getTranslation("Aspect Ratios");
if (typeof translation == "undefined") {
translation = "Aspect Ratios";
}
label.textContent = translation + " " + htmlDecode(value);
}
function localizeWholePage() {