This commit is contained in:
rizky 2024-08-14 22:56:11 -07:00
parent 07dac276b8
commit 518e323c63
4 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import { AlertTriangle, Check, ChevronLeft, Loader2, Plus } from "lucide-react";
import { FMLocal, FMProps } from "../typings";
import { editorFormData } from "./ed-data";
import { formError } from "./error";
import { lang } from "lib/lang";
import { lang, translate } from "lib/lang";
export const formInit = (fm: FMLocal, props: FMProps) => {
for (const [k, v] of Object.entries(props)) {
@ -207,7 +207,7 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
if (fm.is_newly_created) {
fm.is_newly_created = false;
toastSuccess({ addNewText: "Add Another" });
toastSuccess({ addNewText: translate("Add Another") });
}
fm.status = "ready";

View File

@ -4,4 +4,5 @@ export const langEn = {
Delete: "Delete",
"Record Saved": "Record Saved",
"Search": "Search",
"Add Another": "Add Another",
};

View File

@ -6,4 +6,5 @@ export const langId: Record<LangKeyword, string> = {
Delete: "Hapus",
"Record Saved": "Data Tersimpan",
Search: "Cari",
"Add Another": "Tambah Baru",
};

View File

@ -14,3 +14,5 @@ export const lang = {
},
base: null as null | Record<LangKeyword, string>,
};
export const translate = lang.t;