diff --git a/components/app-shell.tsx b/components/app-shell.tsx index be744fb..f69d0f1 100644 --- a/components/app-shell.tsx +++ b/components/app-shell.tsx @@ -2,11 +2,13 @@ import { Icon } from "@iconify/react"; import Link from "next/link"; -import { usePathname } from "next/navigation"; +import { usePathname } from "@/i18n/routing"; import { AnnouncementBar } from "poyraz-ui/organisms"; import { SiteNavbar } from "@/components/site-navbar"; import { NekoFollower } from "@/components/neko-follower"; import { ANNOUNCEMENT_ITEMS, ENABLE_NEKO_FOLLOWER } from "@/data/site-settings"; +import { useLocale } from "next-intl"; +import { getLocalizedValue } from "@/lib/locale"; import dynamic from "next/dynamic"; const AtaturkWidgetModal = dynamic( @@ -20,6 +22,7 @@ type AppShellProps = { export function AppShell({ children }: AppShellProps) { const pathname = usePathname(); + const locale = useLocale(); const announcement = ANNOUNCEMENT_ITEMS[0]; const isStandaloneLinksPage = pathname === "/links" || pathname.startsWith("/links/"); @@ -28,6 +31,9 @@ export function AppShell({ children }: AppShellProps) { return children; } + const localizedText = announcement ? getLocalizedValue(announcement.text, locale) : ""; + const localizedActionLabel = announcement ? getLocalizedValue(announcement.actionLabel, locale) : ""; + return ( <> @@ -40,19 +46,19 @@ export function AppShell({ children }: AppShellProps) { dismissible={false} icon={} action={ - announcement.actionLabel && announcement.actionHref ? ( + localizedActionLabel && announcement.actionHref ? ( - {announcement.actionLabel} + {localizedActionLabel} ) : null } > - {announcement.text} + {localizedText} ) : null}
{children}
diff --git a/components/ataturk-widget-modal.tsx b/components/ataturk-widget-modal.tsx index 67a1e47..216dbdd 100644 --- a/components/ataturk-widget-modal.tsx +++ b/components/ataturk-widget-modal.tsx @@ -5,22 +5,26 @@ import Script from "next/script"; import Image from "next/image"; import { Modal, ModalContent, ModalTrigger, ModalTitle } from "poyraz-ui/molecules"; import { Skeleton } from "poyraz-ui/atoms"; +import { useLocale, useTranslations } from "next-intl"; export function AtaturkWidgetModal() { const [isLoading, setIsLoading] = useState(true); + const t = useTranslations("AtaturkWidget"); + const locale = useLocale(); + return (