fix: Duplicate template options (#51)

* fix: Duplicate template options

* fix: form option i18n text
This commit is contained in:
仓鼠
2024-12-14 10:16:33 +08:00
committed by GitHub
parent 8c8d3e3057
commit d67b9ff4d2
11 changed files with 46 additions and 128 deletions

View File

@@ -1,9 +1,9 @@
import i18next from "i18next"
import { TFunction } from "i18next"
export const settingCoverageTypes: Record<number, string> = {
1: i18next.t("Coverages.Excludes"),
2: i18next.t("Coverages.Only"),
}
export const settingCoverageTypes = (t: TFunction<"translation", undefined>) => ({
1: t("Coverages.Excludes"),
2: t("Coverages.Only"),
})
export const nezhaLang: Record<string, string> = {
"zh-CN": "简体中文(中国大陆)",
@@ -11,8 +11,8 @@ export const nezhaLang: Record<string, string> = {
"en-US": "English",
}
export const wafBlockReasons: Record<number, string> = {
1: i18next.t("LoginFailed"),
2: i18next.t("BruteForceAttackingToken"),
3: i18next.t("BruteForceAttackingAgentSecret"),
}
export const wafBlockReasons = (t: TFunction<"translation", undefined>) => ({
1: t("LoginFailed"),
2: t("BruteForceAttackingToken"),
3: t("BruteForceAttackingAgentSecret"),
})