Skip to content

Commit 0e621ae

Browse files
authored
fix: add type check for undefined, use fallback when no translation for aspect ratios was given (#3025)
1 parent dfff9b7 commit 0e621ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

javascript/localization.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ function refresh_style_localization() {
8181
}
8282

8383
function refresh_aspect_ratios_label(value) {
84-
label = document.querySelector('#aspect_ratios_accordion div span[data-original-text="Aspect Ratios"]')
85-
translation = getTranslation("Aspect Ratios")
86-
label.textContent = translation + " " + htmlDecode(value)
84+
label = document.querySelector('#aspect_ratios_accordion div span[data-original-text="Aspect Ratios"]');
85+
translation = getTranslation("Aspect Ratios");
86+
if (typeof translation == "undefined") {
87+
translation = "Aspect Ratios";
88+
}
89+
label.textContent = translation + " " + htmlDecode(value);
8790
}
8891

8992
function localizeWholePage() {

0 commit comments

Comments
 (0)