feat(api): standardize REST contracts and auth
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const localizeLocaleOptions = () => {
|
||||
const localeSelect = document.querySelector("#login-select-toggle");
|
||||
|
||||
if (!(localeSelect instanceof HTMLSelectElement)) return;
|
||||
|
||||
for (const option of localeSelect.options) {
|
||||
const optionUrl = new URL(option.value, window.location.origin);
|
||||
const locale = optionUrl.searchParams.get("kc_locale");
|
||||
|
||||
if (locale === "zh-CN") option.textContent = "简体中文";
|
||||
if (locale === "en") option.textContent = "English";
|
||||
}
|
||||
};
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", localizeLocaleOptions, {
|
||||
once: true,
|
||||
});
|
||||
} else {
|
||||
localizeLocaleOptions();
|
||||
}
|
||||
Reference in New Issue
Block a user