优化当前彩金池-安全线
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
"profitCalcHint": "Sum of (win amount including BIGWIN minus 100 ticket cost) per round; refreshes every 2s while open.",
|
||||
"tierRuleTitle": "Tier Rule",
|
||||
"tierRuleContent": "When player profit in this pool is below safety line, use player T*_weight; when above or equal, use pool T*_weight (kill).",
|
||||
"killScoreWeights": "Kill weights (type=1 read-only)",
|
||||
"killScoreWeights": "Kill weights",
|
||||
"killWeightNote": "(Kill weights from pool config type=1; edit in list.)",
|
||||
"btnResetProfit": "Reset Player Total Profit",
|
||||
"btnSaveSafetyLine": "Save Safety Line",
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"profitCalcHint": "计算方式:每局按“当前中奖金额(含超级大奖 BIGWIN)减去抽奖券费用 100”累加,弹窗打开期间每 2 秒自动刷新",
|
||||
"tierRuleTitle": "抽奖档位规则",
|
||||
"tierRuleContent": "当玩家在当前彩金池的累计盈利 低于安全线 时,按 玩家 的 T*_weight 权重抽取档位;当累计盈利 高于或等于安全线 时,按 当前彩金池 的 T*_weight 权重抽取档位(杀分)。",
|
||||
"killScoreWeights": "杀分权重(type=1 只读)",
|
||||
"killWeightNote": "(杀分权重来自奖池配置 type=1,请在列表中编辑对应记录)",
|
||||
"killScoreWeights": "杀分权重",
|
||||
"killWeightNote": "(杀分权重来自奖池配置,请在列表中编辑对应记录)",
|
||||
"btnResetProfit": "重置玩家累计盈利",
|
||||
"btnSaveSafetyLine": "保存安全线",
|
||||
"ruleSafetyLineRequired": "请输入安全线",
|
||||
|
||||
@@ -27,6 +27,12 @@ function getModuleKey(locale: string, path: string): string {
|
||||
let lastLoadedPath: string | null = null
|
||||
let lastLoadedLocale: string | null = null
|
||||
|
||||
/** 获取当前语言(locale 可能是 string 或 Ref) */
|
||||
function getCurrentLocale(): string {
|
||||
const loc = i18n.global.locale
|
||||
return typeof loc === 'string' ? loc : (loc as { value: string }).value
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载并合并页面翻译到 i18n 的 page 命名空间
|
||||
*/
|
||||
@@ -36,7 +42,7 @@ export async function loadPageLocale(routePath: string): Promise<void> {
|
||||
clearPageLocale()
|
||||
return
|
||||
}
|
||||
const locale = i18n.global.locale.value
|
||||
const locale = getCurrentLocale()
|
||||
const key = getModuleKey(locale, path)
|
||||
const modules = locale === LanguageEnum.EN ? enModules : zhModules
|
||||
const loader = modules[key]
|
||||
@@ -64,7 +70,7 @@ export async function loadPageLocale(routePath: string): Promise<void> {
|
||||
* 清除 page 命名空间(进入无页面翻译的路由时调用)
|
||||
*/
|
||||
export function clearPageLocale(): void {
|
||||
const locale = i18n.global.locale.value
|
||||
const locale = getCurrentLocale()
|
||||
const messages = i18n.global.getLocaleMessage(locale) as Record<string, unknown>
|
||||
if (messages && 'page' in messages) {
|
||||
const next = { ...messages }
|
||||
|
||||
Reference in New Issue
Block a user