i18n(sidebar): localise company delete confirmation + Yes/No buttons (P3-48)

Delete-company confirmation text now uses sidebar.deleteCompanyConfirm key
with {name} placeholder; Yes/No buttons route through common.yes/no.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 23:09:15 -04:00
1 parent 3a1f79324d
commit d8c2e10005
3 files changed
+5 -3

No files matched your search

+1
View File
@@ -257,6 +257,7 @@ export const en: Record<string, string> = {
"common.close": "Close", "common.close": "Close",
"common.yes": "Yes", "common.yes": "Yes",
"common.no": "No", "common.no": "No",
"sidebar.deleteCompanyConfirm": "Delete {name}?",
"common.confirm": "Confirm", "common.confirm": "Confirm",
"common.status": "Status", "common.status": "Status",
"common.started": "Started", "common.started": "Started",
+1
View File
@@ -257,6 +257,7 @@ export const zh: Record<string, string> = {
"common.close": "关闭", "common.close": "关闭",
"common.yes": "是", "common.yes": "是",
"common.no": "否", "common.no": "否",
"sidebar.deleteCompanyConfirm": "删除{name}?",
"common.confirm": "确认", "common.confirm": "确认",
"common.status": "状态", "common.status": "状态",
"common.started": "开始时间", "common.started": "开始时间",
+3 -3
View File
@@ -86,20 +86,20 @@ export function SidebarView({
<div key={company.id} className="group flex items-center"> <div key={company.id} className="group flex items-center">
{confirmDeleteCompanyId === company.id ? ( {confirmDeleteCompanyId === company.id ? (
<div className="flex w-full items-center gap-2 px-3 py-2"> <div className="flex w-full items-center gap-2 px-3 py-2">
<span className="flex-1 truncate text-[12px] text-destructive">Delete {company.name}?</span> <span className="flex-1 truncate text-[12px] text-destructive">{t("sidebar.deleteCompanyConfirm", `Delete ${company.name}?`).replace("{name}", company.name)}</span>
<button <button
type="button" type="button"
className="rounded px-2 py-0.5 text-[11px] font-semibold text-destructive transition hover:bg-destructive hover:text-primary-foreground" className="rounded px-2 py-0.5 text-[11px] font-semibold text-destructive transition hover:bg-destructive hover:text-primary-foreground"
onClick={() => void deleteCompany(company.id)} onClick={() => void deleteCompany(company.id)}
> >
Yes {t("common.yes")}
</button> </button>
<button <button
type="button" type="button"
className="rounded px-2 py-0.5 text-[11px] font-semibold text-muted-foreground transition hover:bg-muted" className="rounded px-2 py-0.5 text-[11px] font-semibold text-muted-foreground transition hover:bg-muted"
onClick={() => setConfirmDeleteCompanyId(null)} onClick={() => setConfirmDeleteCompanyId(null)}
> >
No {t("common.no")}
</button> </button>
</div> </div>
) : ( ) : (