From 2bb97c5a24efa5edc98c30c2fac1765f2f8eda0e Mon Sep 17 00:00:00 2001 From: sabdayagra Date: Wed, 5 Feb 2025 21:33:18 +0700 Subject: [PATCH] feat: eng language --- app/[locale]/auth/registration/page.tsx | 144 ++++++++++++----------- app/[locale]/page.tsx | 24 ++-- components/landing-page/news-tickers.tsx | 4 +- messages/en.json | 58 ++++++++- messages/in.json | 59 +++++++++- 5 files changed, 208 insertions(+), 81 deletions(-) diff --git a/app/[locale]/auth/registration/page.tsx b/app/[locale]/auth/registration/page.tsx index c596cfda..4d84dcfc 100644 --- a/app/[locale]/auth/registration/page.tsx +++ b/app/[locale]/auth/registration/page.tsx @@ -88,16 +88,16 @@ const page = () => { }; const validationSchema = Yup.object().shape({ - firstName: Yup.string().required("Nama Lengkap tidak boleh kosong"), - username: Yup.string().required("Username tidak boleh kosong"), - phoneNumber: Yup.string().required("Nomor Telepon tidak boleh kosong"), - address: Yup.string().required("Alamat tidak boleh kosong"), - email: Yup.string().required("Email tidak boleh kosong"), - provinsi: Yup.string().required("Provinsi tidak boleh kosong"), - kota: Yup.string().required("Kota tidak boleh kosong"), - kecamatan: Yup.string().required("Kecamatan tidak boleh kosong"), - password: Yup.string().required("Kata Sandi tidak boleh kosong"), - passwordConf: Yup.string().required("Konfirmasi Kata Sandi tidak boleh kosong"), + firstName: Yup.string().required(t("nameEmpty")), + username: Yup.string().required(t("usernameEmpty")), + phoneNumber: Yup.string().required(t("numberEmpty")), + address: Yup.string().required(t("addressEmpty")), + email: Yup.string().required(t("emailEmpty")), + provinsi: Yup.string().required(t("provinceEmpty")), + kota: Yup.string().required(t("cityEmpty")), + kecamatan: Yup.string().required(t("subdistrictEmpty")), + password: Yup.string().required(t("passwordEmpty")), + passwordConf: Yup.string().required(t("confirmEmpty")), }); const formOptions = { @@ -358,7 +358,7 @@ const page = () => { setEmailValidate(""); setEmail(e); } else { - setEmailValidate("Email tidak valid"); + setEmailValidate(t("emailValid")); setEmail(""); } }; @@ -562,7 +562,7 @@ const page = () => { : {} } > -

{stepThreeActive ? "Silahkan lengkapi data pengguna" : "Silahkan registrasi terlebih dahulu"}

+

{stepThreeActive ? t("userData") : t("registerFirst")}

{t("alreadyHave")}{" "} @@ -580,14 +580,14 @@ const page = () => { : {} } > -

Masukkan Kode OTP

-

Silahkan cek inbox atau kotak spam pada email Anda.

+

{t("enterOTP")}

+

{t("checkInbox")}

{ } > - setAssociation(e.target.value)} + >
{errors.association?.message}
@@ -625,7 +630,7 @@ const page = () => { {Number(category) == 7 ? (
setPersonilNRP(event.target.value)} />

{userIdentityValidate}

@@ -645,9 +650,9 @@ const page = () => { } > - setJournalistCertificate(event.target.value)} /> + setJournalistCertificate(event.target.value)} />
) : ( "" @@ -656,7 +661,7 @@ const page = () => { - checkEmail(event.target.value)} /> + checkEmail(event.target.value)} />

{emailValidate}

@@ -685,10 +690,10 @@ const page = () => {

handleResendOTP()}> - Kirim Ulang ({convertMilisecondsToHour(timerCount)}) + {t("resending")} ({convertMilisecondsToHour(timerCount)}) handleVerifyOTP()}> - Lanjut + {t("next")}
@@ -698,7 +703,7 @@ const page = () => { {Number(category) == 6 || Number(category) == 7 ? (
{ autoComplete="off" className={`mb-3 ${errors.memberIdentity ? "block" : ""}`} {...register("memberIdentity")} - placeholder="Masukan Nomor Identitas" + placeholder={t("inputNumberIdentity")} onChange={(e) => handleIdentity(e.target.value)} disabled /> @@ -717,9 +722,9 @@ const page = () => { )}
- +
{errors.firstName?.message}
@@ -731,7 +736,7 @@ const page = () => { type="text" autoComplete="off" className={`${errors.username ? "block" : ""}`} - placeholder="Masukan Username" + placeholder={t("enterUsername")} onChange={(e) => { setValUsername(e.target.value.trim()); }} @@ -754,27 +759,27 @@ const page = () => {
- +
{errors.phoneNumber?.message}
-