Skip to content

Commit 867866d

Browse files
committed
Localize record dropdown menu options and fix loader Japanese support
1 parent 39575b7 commit 867866d

165 files changed

Lines changed: 1157 additions & 83 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,12 +903,12 @@
903903

904904
<ul id="recorddropdown" class="dropdown-content">
905905
<li>
906-
<a id="record-with-menus" role="button" tabindex="0"
906+
<a id="record-with-menus" role="button" tabindex="0" data-i18n="Record canvas and toolbars"
907907
>Record canvas and toolbars</a
908908
>
909909
</li>
910910
<li>
911-
<a id="record-canvas-only" role="button" tabindex="0"
911+
<a id="record-canvas-only" role="button" tabindex="0" data-i18n="Record canvas only"
912912
>Record canvas only</a
913913
>
914914
</li>

js/loader.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,24 @@ requirejs(["i18next", "i18nextHttpBackend"], function (i18next, i18nextHttpBacke
295295

296296
function updateContent() {
297297
if (!i18next.isInitialized) return;
298+
const lang = i18next.language;
298299
const elements = document.querySelectorAll("[data-i18n]");
299300
elements.forEach(element => {
300301
const key = element.getAttribute("data-i18n");
301-
element.textContent = i18next.t(key);
302+
if (lang && lang.startsWith("ja")) {
303+
const kanaPref =
304+
(window.localStorage && window.localStorage.getItem("kanaPreference")) ||
305+
"kanji";
306+
const script = kanaPref === "kana" ? "kana" : "kanji";
307+
const result = i18next.t(key, { returnObjects: true });
308+
if (result && typeof result === "object") {
309+
element.textContent = result[script] || key;
310+
} else {
311+
element.textContent = typeof result === "string" ? result : key;
312+
}
313+
} else {
314+
element.textContent = i18next.t(key);
315+
}
302316
});
303317
}
304318

locales/af.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/agr.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/am.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/ar.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/ayc.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/bg.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/bi.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/bn.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)