diff --git a/app/layout.tsx b/app/layout.tsx index 792ff83..0e3d497 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -28,19 +28,10 @@ import storedLanguage from "@/store/language-store"; // }, // }; -export default function RootLayout({ - children, - params, -}: { - children: ReactNode; - params: { locale: string }; -}) { - // const { locale } = params; +export default function RootLayout({ children }: { children: ReactNode }) { const [localeNow, setLocaleNow] = useState("id"); const locale = storedLanguage((state) => state.locale); - // Load messages dynamically based on locale - // const messages = (await import(`../messages/${locale}.json`)).default; useEffect(() => { if (locale) { diff --git a/components/landing/BannerHumas.tsx b/components/landing/BannerHumas.tsx index 82dafc4..6786c8d 100644 --- a/components/landing/BannerHumas.tsx +++ b/components/landing/BannerHumas.tsx @@ -1,6 +1,8 @@ +import { useTranslations } from "next-intl"; import React from "react"; export default function BannerHumas() { + const t = useTranslations("Banner"); return (

- TRANSPARANSI, PATISIPASI, DAN LAYANAN TERBAIK DARI POLRI UNTUK - INDONESIA -

-

- {`"Menyajikan Informasi Terpercaya dan Mendekatkan Polri dengan - Masyarakat"`} + {t("jumbotron")}

+

{`"${t("phrase")}"`}

); diff --git a/components/landing/CategorySatker.tsx b/components/landing/CategorySatker.tsx index 18a355c..1b75caa 100644 --- a/components/landing/CategorySatker.tsx +++ b/components/landing/CategorySatker.tsx @@ -13,12 +13,14 @@ import { import { ChevronLeftWhite, ChevronRightWhite } from "../icons"; import React from "react"; import Link from "next/link"; +import { useTranslations } from "next-intl"; export default function CategorySatker() { const { isOpen, onOpen, onOpenChange } = useDisclosure(); const [scrollBehavior, setScrollBehavior] = React.useState("inside"); const [modalPlacement, setModalPlacement] = React.useState("auto"); + const t = useTranslations("Landing"); const list = [ { @@ -299,7 +301,7 @@ export default function CategorySatker() { return (
- Kategori Satker + {t("kategoriSatker")}
@@ -328,7 +330,7 @@ export default function CategorySatker() { className="bg-white text-[#DD8306] font-bold" size="sm" > - Lihat Lebih Banyak + {t("lebihBanyak")} ( <> - Berita Wilayah + {t("kategoriSatker")} {SatkerAll.map((item: any, index: any) => ( @@ -368,7 +370,7 @@ export default function CategorySatker() { diff --git a/components/landing/Footer.tsx b/components/landing/Footer.tsx index 0c80965..bc36178 100644 --- a/components/landing/Footer.tsx +++ b/components/landing/Footer.tsx @@ -2,8 +2,11 @@ import { Button } from "@nextui-org/button"; import { Input } from "@nextui-org/input"; import { MailIcon, SendIcon } from "../icons"; import Link from "next/link"; +import { useTranslations } from "next-intl"; export default function Footer() { + const t2 = useTranslations("Navbar"); + const t3 = useTranslations("LandingInformasiPublik"); return (
@@ -25,10 +28,12 @@ export default function Footer() { Kontak
- Tentang PPID - Profil Pimpinan Polri - Struktur Organisasi - Visi & Misi + {t2("tentang")} PPID + {t2("profilPimpinan")} + {t2("strukturOrganisasi")} + + {t2("visi")} & {t2("misi")} + Logo
@@ -36,31 +41,31 @@ export default function Footer() { href="https://siberpresisi.com/informasi-publik/informasi-berkala" target="_blank" > - Informasi Berkala + {t3("InformasiBerkala")} - Informasi Serta Merta + {t3("InformasiSertaMerta")} - Informasi Setiap Saat + {t3("InformasiSetiapSaat")} - Informasi Dikecualikan + {t3("InformasiDikecualikan")} - UU & Peraturan + {t3("UUdanPeraturan")} {/* Penerangan Satuan */}
diff --git a/components/landing/HeaderNews.tsx b/components/landing/HeaderNews.tsx index fa1b561..241d959 100644 --- a/components/landing/HeaderNews.tsx +++ b/components/landing/HeaderNews.tsx @@ -11,9 +11,11 @@ import GPRKominfo from "../ui/social-media/gpr-kominfo"; import { useEffect, useState } from "react"; import { getListArticle } from "@/service/article"; import { convertDateFormat } from "@/utils/global"; +import { useTranslations } from "next-intl"; export default function HeaderNews() { const [article, setArticle] = useState([]); + const t = useTranslations("Landing"); useEffect(() => { async function getArticle() { @@ -28,7 +30,7 @@ export default function HeaderNews() {
-

Berita Terkini

+

{t("berita")}

{article?.map((data: any) => (
- Lihat Semua + {t("semua")}
diff --git a/components/landing/MedolUpdate.tsx b/components/landing/MedolUpdate.tsx index 5ba14aa..46e2e0e 100644 --- a/components/landing/MedolUpdate.tsx +++ b/components/landing/MedolUpdate.tsx @@ -22,6 +22,7 @@ import { } from "@/service/third-party-service"; import { convertDateFormatNoTime } from "@/utils/global"; import PolriTvWidget from "../ui/social-media/polri-tv"; +import { useTranslations } from "next-intl"; export default function MedolUpdate() { const [selectedTab, setSelectedTab] = useState("mediahub"); @@ -29,6 +30,8 @@ export default function MedolUpdate() { const [tbnUpdate, setTbnUpdate] = useState([]); const [inpUpdate, setInpUpdate] = useState([]); + const t = useTranslations("Landing"); + useEffect(() => { if (selectedTab === "mediahub" && mediahubUpdate.length < 1) { getMedihubUpdate(); @@ -128,7 +131,7 @@ export default function MedolUpdate() { color="warning" variant="bordered" > - Lihat Lebih Banyak + {t("lebihBanyak")}
@@ -176,7 +179,7 @@ export default function MedolUpdate() { color="warning" variant="bordered" > - Lihat Lebih Banyak + {t("lebihBanyak")}
@@ -224,7 +227,7 @@ export default function MedolUpdate() { color="warning" variant="bordered" > - Lihat Lebih Banyak + {t("lebihBanyak")}
@@ -246,7 +249,7 @@ export default function MedolUpdate() { color="warning" variant="bordered" > - Lihat Lebih Banyak + {t("lebihBanyak")}
diff --git a/components/landing/RegionalNews.tsx b/components/landing/RegionalNews.tsx index 024265e..0c937a9 100644 --- a/components/landing/RegionalNews.tsx +++ b/components/landing/RegionalNews.tsx @@ -13,6 +13,7 @@ import { import { ChevronLeftWhite, ChevronRightWhite } from "../icons"; import React, { useEffect, useState } from "react"; import Link from "next/link"; +import { useTranslations } from "next-intl"; export default function RegionalNews() { const [limitedData, setLimitedData] = useState([]); @@ -20,6 +21,7 @@ export default function RegionalNews() { const [scrollBehavior, setScrollBehavior] = React.useState("inside"); const [modalPlacement, setModalPlacement] = React.useState("auto"); + const t = useTranslations("Landing"); const listPolda = [ { @@ -294,7 +296,7 @@ export default function RegionalNews() { return (
- Berita Wilayah + {t("beritaWilayah")}
@@ -323,7 +325,7 @@ export default function RegionalNews() { className="bg-[#DD8306] text-white font-bold" size="sm" > - Lihat Lebih Banyak + {t("lebihBanyak")} ( <> - Berita Wilayah + {t("beritaWilayah")} {listPoldaAll.map((item: any, index: any) => ( @@ -367,7 +369,7 @@ export default function RegionalNews() { diff --git a/messages/en.json b/messages/en.json index 9e54d9a..cb90480 100644 --- a/messages/en.json +++ b/messages/en.json @@ -10,5 +10,29 @@ "profilPimpinan": "Profile of The Police Leader", "tugas": "Duties", "fungsi": "Functions" + }, + "Banner": { + "jumbotron": "TRANSPARENCY, PARTICIPATION, AND THE BEST SERVICES FROM POLRI FOR INDONESIA", + "phrase": "Providing Trusted Information and Bringing Polri Closer to the Community" + }, + "Footer": {}, + "LandingInformasiPublik": { + "InformasiPublik": "Public Information", + "InformasiSertaMerta": "Immediate Information", + "InformasiBerkala": "Periodic Information", + "InformasiSetiapSaat": "Information on Request", + "InformasiDikecualikan": "Excluded Information", + "LayananPolriDigital": "Digital Polri Services", + "UUdanPeraturan": "Laws and Segulations", + "Pusiknas": "Pusiknas", + "SatuData": "Satu Data" + }, + "Landing": { + "berita": "Breaking News", + "semua": "See All", + "lebihBanyak": "See More", + "kategoriSatker": "Satker Cateogry", + "beritaWilayah": "Regional News", + "tutup": "Close" } } diff --git a/messages/id.json b/messages/id.json index ab69ea1..665f2cc 100644 --- a/messages/id.json +++ b/messages/id.json @@ -10,5 +10,28 @@ "profilPimpinan": "Profil Pimpinan Polri", "tugas": "Tugas", "fungsi": "Fungsi" + }, + "Banner": { + "jumbotron": "TRANSPARANSI, PATISIPASI, DAN LAYANAN TERBAIK DARI POLRI UNTUK INDONESIA", + "phrase": "Menyajikan Informasi Terpercaya dan Mendekatkan Polri dengan Masyarakat" + }, + "LandingInformasiPublik": { + "InformasiPublik": "Informasi Publik", + "InformasiSertaMerta": "Informasi Serta Merta", + "InformasiBerkala": "Informasi Berkala", + "InformasiSetiapSaat": "Informasi Setiap Saat", + "InformasiDikecualikan": "Informasi Dikecualikan", + "LayananPolriDigital": "Layanan Polri Digital", + "UUdanPeraturan": "UU & Peraturan", + "Pusiknas": "Pusiknas", + "SatuData": "Satu Data" + }, + "Landing": { + "berita": "Berita Terkini", + "semua": "Lihat Semua", + "lebihBanyak": "Lihat Lebih Banyak", + "kategoriSatker": "Kategori Satker", + "beritaWilayah": "Berita Wilayah", + "tutup": "Tutup" } }