Skip to content

Commit 4ffa6a0

Browse files
authored
Simplify translation fallback mechanism
Refactor translation logic to remove title case fallback.
1 parent 74ca451 commit 4ffa6a0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

js/utils/utils.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ function _(text, options = {}) {
108108
translated = i18next.t(text, options);
109109
if (!translated || translated === text) translated = i18next.t(cleanedText, options);
110110
if (!translated || translated === text) translated = i18next.t(text.toLowerCase(), options);
111-
if (!translated || translated === text) {
112-
const titleCase = text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
113-
translated = i18next.t(titleCase, options);
114-
}
115111
if (!translated || translated === text) {
116112
const hyphenatedText = cleanedText.replace(/ /g, "-");
117113
translated = i18next.t(hyphenatedText, options);
@@ -1649,4 +1645,4 @@ if (typeof module !== "undefined" && module.exports) {
16491645
hexToRGB,
16501646
hex2rgb
16511647
};
1652-
}
1648+
}

0 commit comments

Comments
 (0)