feat: localize all hardcoded strings in Root CA Management and Archive UI

This commit is contained in:
dyzulk
2026-01-07 10:58:15 +07:00
parent 8ff136d086
commit a1c38e4ab2
6 changed files with 92 additions and 36 deletions

View File

@@ -62,25 +62,21 @@ export default function RootCaManagementClient() {
setActiveSync(syncKey);
try {
let endpoint = "/api/admin/ca-certificates/sync-cdn";
let msg = `Sync successful (Mode: ${mode})`;
if (type === 'crt') {
endpoint = "/api/admin/ca-certificates/sync-crt";
msg = `CRT Files Sync successful (${mode})`;
} else if (type === 'installers') {
endpoint = "/api/admin/ca-certificates/sync-installers";
msg = `Individual Installers Sync successful (${mode})`;
} else if (type === 'bundles') {
endpoint = "/api/admin/ca-certificates/sync-bundles";
msg = "Global Bundles Sync successful";
}
const response = await axios.post(endpoint, { mode });
addToast(response.data.message || msg, "success");
addToast(response.data.message || t("toast_sync_success"), "success");
mutate();
} catch (err: any) {
console.error(err);
addToast(err.response?.data?.message || "Sync failed", "error");
addToast(err.response?.data?.message || t("toast_sync_failed"), "error");
} finally {
setActiveSync(null);
}
@@ -90,11 +86,11 @@ export default function RootCaManagementClient() {
setIsPromoting(true);
try {
const response = await axios.post(`/api/admin/ca-certificates/${uuid}/promote`);
addToast(response.data.message || "Promoted successfully", "success");
addToast(response.data.message || t("toast_promote_success"), "success");
mutate();
} catch (err: any) {
console.error(err);
addToast(err.response?.data?.message || "Promotion failed", "error");
addToast(err.response?.data?.message || t("toast_promote_failed"), "error");
} finally {
setIsPromoting(false);
}
@@ -192,8 +188,8 @@ export default function RootCaManagementClient() {
{/* Full-width Archive History */}
<ComponentCard
title="Version Archives"
desc="Browse historical versions and promote them back to Latest if needed. This table provides full visibility into your CDN audit trail."
title={t("archive_management_title")}
desc={t("archive_management_desc")}
>
<ArchiveManagementTable
certificates={certificates}