mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-04 12:40:08 +00:00
refactor: enum i18n
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { TFunction } from "i18next"
|
||||
import i18n from "@/lib/i18n"
|
||||
|
||||
export const triggerModes = (t: TFunction<"translation", undefined>) => ({
|
||||
0: t("Always"),
|
||||
1: t("Once"),
|
||||
})
|
||||
export const triggerModes: Record<number, string> = {
|
||||
0: i18n.t("Always"),
|
||||
1: i18n.t("Once"),
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { TFunction } from "i18next"
|
||||
import i18n from "@/lib/i18n"
|
||||
|
||||
export const cronTypes = (t: TFunction<"translation", undefined>) => ({
|
||||
0: t("Scheduled"),
|
||||
1: t("Trigger"),
|
||||
})
|
||||
export const cronTypes: Record<number, string> = {
|
||||
0: i18n.t("Scheduled"),
|
||||
1: i18n.t("Trigger"),
|
||||
}
|
||||
|
||||
export const cronCoverageTypes = (t: TFunction<"translation", undefined>) => ({
|
||||
0: t("Coverages.Only"),
|
||||
1: t("Coverages.Excludes"),
|
||||
2: t("Coverages.Alarmed"),
|
||||
})
|
||||
export const cronCoverageTypes: Record<number, string> = {
|
||||
0: i18n.t("Coverages.Only"),
|
||||
1: i18n.t("Coverages.Excludes"),
|
||||
2: i18n.t("Coverages.Alarmed"),
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TFunction } from "i18next"
|
||||
import i18n from "@/lib/i18n"
|
||||
|
||||
export const serviceTypes: Record<number, string> = {
|
||||
1: "HTTP GET",
|
||||
@@ -6,7 +6,7 @@ export const serviceTypes: Record<number, string> = {
|
||||
3: "TCPing",
|
||||
}
|
||||
|
||||
export const serviceCoverageTypes = (t: TFunction<"translation", undefined>) => ({
|
||||
0: t("Coverages.Excludes"),
|
||||
1: t("Coverages.Only"),
|
||||
})
|
||||
export const serviceCoverageTypes: Record<number, string> = {
|
||||
0: i18n.t("Coverages.Excludes"),
|
||||
1: i18n.t("Coverages.Only"),
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { TFunction } from "i18next"
|
||||
import i18n from "@/lib/i18n"
|
||||
|
||||
export const settingCoverageTypes = (t: TFunction<"translation", undefined>) => ({
|
||||
1: t("Coverages.Excludes"),
|
||||
2: t("Coverages.Only"),
|
||||
})
|
||||
export const settingCoverageTypes: Record<number, string> = {
|
||||
1: i18n.t("Coverages.Excludes"),
|
||||
2: i18n.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 = (t: TFunction<"translation", undefined>) => ({
|
||||
1: t("LoginFailed"),
|
||||
2: t("BruteForceAttackingToken"),
|
||||
3: t("BruteForceAttackingAgentSecret"),
|
||||
})
|
||||
export const wafBlockReasons: Record<number, string> = {
|
||||
1: i18n.t("LoginFailed"),
|
||||
2: i18n.t("BruteForceAttackingToken"),
|
||||
3: i18n.t("BruteForceAttackingAgentSecret"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user