Skip to content

Commit

Permalink
fix: add type check for undefined, use fallback when no translation f…
Browse files Browse the repository at this point in the history
…or aspect ratios was given (#3025)
  • Loading branch information
mashb1t committed May 27, 2024
1 parent dfff9b7 commit 0e621ae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions javascript/localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 0e621ae

Please sign in to comment.