feat(i18n): add saveFailed message and dimensionRatesMixedHint to locale files

- Updated English, Nepali, and Chinese locale files to include a new message for "Failed to save configuration".
- Added a hint for mixed rebate rates within the same dimension to enhance user understanding.
- Improved internationalization support across multiple locales for better user experience in the admin interface.
This commit is contained in:
2026-05-26 11:23:36 +08:00
parent 4080f0b601
commit 7fb5ec6dff
10 changed files with 181 additions and 65 deletions

View File

@@ -0,0 +1,12 @@
import type { ConfigVersionSummary } from "@/types/api/admin-config";
/** Prefer newest draft, then active, otherwise highest numeric id — matches config doc UX. */
export function pickDefaultConfigVersionId(list: ConfigVersionSummary[]): string | null {
if (list.length === 0) {
return null;
}
const drafts = list.filter((x) => x.status === "draft").sort((a, b) => b.id - a.id);
const active = list.find((x) => x.status === "active");
const pick = drafts[0] ?? active ?? [...list].sort((a, b) => b.id - a.id)[0];
return pick ? String(pick.id) : null;
}