|
@@ -2,7 +2,7 @@ import { compress, debounce, isScrollable, type Stringifiable } from "@sv443-net
|
|
|
import { type defaultData, formatVersion, getFeature, getFeatures, migrations, setFeatures } from "../config.js";
|
|
|
import { buildNumber, compressionFormat, host, mode, scriptInfo } from "../constants.js";
|
|
|
import { featInfo, disableBeforeUnload } from "../features/index.js";
|
|
|
-import { error, getResourceUrl, info, log, resourceAsString, getLocale, hasKey, initTranslations, setLocale, t, arrayWithSeparators, tp, type TrKey, onInteraction, getDomain, copyToClipboard, warn, compressionSupported, tryToDecompressAndParse, setInnerHtml, type TrLocale } from "../utils/index.js";
|
|
|
+import { error, getResourceUrl, info, log, resourceAsString, getLocale, hasKey, initTranslations, setLocale, t, arrayWithSeparators, tp, type TrKey, onInteraction, getDomain, copyToClipboard, warn, compressionSupported, tryToDecompressAndParse, setInnerHtml, type TrLocale, tl } from "../utils/index.js";
|
|
|
import { emitSiteEvent, siteEvents } from "../siteEvents.js";
|
|
|
import { getChangelogDialog, getFeatHelpDialog, showPrompt } from "../dialogs/index.js";
|
|
|
import type { FeatureCategory, FeatureKey, FeatureConfig, HotkeyObj, FeatureInfo } from "../types.js";
|
|
@@ -314,11 +314,18 @@ async function mountCfgMenu() {
|
|
|
const newText = t("lang_changed_prompt_reload");
|
|
|
|
|
|
const newLangEmoji = localeMapping[featConf.locale]?.emoji ? `${localeMapping[featConf.locale].emoji}\n` : "";
|
|
|
- const initLangEmoji = initLocale && localeMapping[initLocale]?.emoji ? `${localeMapping[initLocale].emoji}\n` : "";
|
|
|
+ const initLangEmoji = localeMapping[initLocale!]?.emoji ? `${localeMapping[initLocale!].emoji}\n` : "";
|
|
|
|
|
|
const confirmText = newText !== initLangReloadText ? `${newLangEmoji}${newText}\n\n\n${initLangEmoji}${initLangReloadText}` : newText;
|
|
|
|
|
|
- if(await showPrompt({ type: "confirm", message: confirmText })) {
|
|
|
+ if(await showPrompt({
|
|
|
+ type: "confirm",
|
|
|
+ message: confirmText,
|
|
|
+ confirmBtnText: () => `${t("prompt_confirm")} / ${tl(initLocale!, "prompt_confirm")}`,
|
|
|
+ confirmBtnTooltip: () => `${t("click_to_confirm_tooltip")} / ${tl(initLocale!, "click_to_confirm_tooltip")}`,
|
|
|
+ denyBtnText: (type) => `${t(type === "alert" ? "prompt_close" : "prompt_cancel")} / ${tl(initLocale!, type === "alert" ? "prompt_close" : "prompt_cancel")}`,
|
|
|
+ denyBtnTooltip: (type) => `${t(type === "alert" ? "click_to_close_tooltip" : "click_to_cancel_tooltip")} / ${tl(initLocale!, type === "alert" ? "click_to_close_tooltip" : "click_to_cancel_tooltip")}`,
|
|
|
+ })) {
|
|
|
closeCfgMenu();
|
|
|
disableBeforeUnload();
|
|
|
location.reload();
|