- 新建一级代理改为选择已有玩家;新建用户可选一级代理 - 操作日志/注单等扁平 key 翻译;清理 src 内误生成 .js,Vite 优先解析 .ts Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
706 B
TypeScript
20 lines
706 B
TypeScript
import { resolveAdminMessage } from '../i18n/resolve-message';
|
|
import type { AdminLocale } from '../i18n/admin-messages';
|
|
import { getAdminLocale } from '../i18n';
|
|
|
|
export function auditActionLabel(action: string, locale?: AdminLocale) {
|
|
return resolveAdminMessage(`audit.action.${action}`, locale) ?? action;
|
|
}
|
|
|
|
export function auditModuleLabel(module: string, locale?: AdminLocale) {
|
|
return resolveAdminMessage(`audit.module.${module}`, locale) ?? module;
|
|
}
|
|
|
|
export function useAuditLabels() {
|
|
const loc = () => getAdminLocale();
|
|
return {
|
|
auditActionLabel: (action: string) => auditActionLabel(action, loc()),
|
|
auditModuleLabel: (module: string) => auditModuleLabel(module, loc()),
|
|
};
|
|
}
|