From 52adeba4a6df33c86840aa8163087d7bdb0f0d7d Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 07:43:34 +0000 Subject: [PATCH 1/3] Add src/app/langContext.tsx --- src/app/langContext.tsx | 57 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/app/langContext.tsx diff --git a/src/app/langContext.tsx b/src/app/langContext.tsx new file mode 100644 index 0000000..7782623 --- /dev/null +++ b/src/app/langContext.tsx @@ -0,0 +1,57 @@ +"use client"; + +import React, { createContext, useContext, useState, useEffect, useCallback } from "react"; + +type Language = "en" | "ku"; +type Direction = "ltr" | "rtl"; + +interface LangContextType { + lang: Language; + dir: Direction; + setLanguage: (language: Language) => void; +} + +const LangContext = createContext(undefined); + +export function LangProvider({ children }: { children: React.ReactNode }) { + const [lang, setLang] = useState(() => { + if (typeof window !== "undefined") { + return (localStorage.getItem("lang") as Language) || "en"; + } + return "en"; + }); + const [dir, setDir] = useState(() => { + if (typeof window !== "undefined") { + const storedLang = localStorage.getItem("lang"); + return storedLang === "ku" ? "rtl" : "ltr"; + } + return "ltr"; + }); + + useEffect(() => { + if (typeof document !== "undefined") { + document.documentElement.setAttribute("lang", lang); + document.documentElement.setAttribute("dir", dir); + localStorage.setItem("lang", lang); + } + }, [lang, dir]); + + const updateLanguage = useCallback((newLang: Language) => { + setLang(newLang); + setDir(newLang === "ku" ? "rtl" : "ltr"); + }, []); + + return ( + + {children} + + ); +} + +export function useLang() { + const context = useContext(LangContext); + if (context === undefined) { + throw new Error("useLang must be used within a LangProvider"); + } + return context; +} \ No newline at end of file From 840a72de7680f597fc8831eaa5645ba44ebc453e Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 07:43:35 +0000 Subject: [PATCH 2/3] Update src/app/page.tsx --- src/app/page.tsx | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 566a4c4..3976c29 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -42,7 +42,7 @@ export default function LandingPage() { { name: "Reservations", id: "#contact"}, { - name: "کوردی", id: "#" + name: "کوردی", id: "#hero" } ]} brandName="Obaw Restaurant" @@ -177,18 +177,18 @@ export default function LandingPage() { useInvertedBackground={false} testimonials={[ { - id: "1", name: "Faryal Minhas", handle: "@FaryalM", testimonial: "A new restaurant. We had breakfast which was excellent. The view from the restaurant is worth everything, just breathtaking. Would definitely go back and recommend.", imageSrc: "http://img.b2bpic.net/free-photo/couple-having-date-together-luxurious-restaurant_23-2150517423.jpg", imageAlt: "Customer Faryal Minhas"}, + id: "1", name: "Faryal Minhas", handle: "@FaryalM", testimonial: "چێشتخانەیەکی نوێ. نانی بەیانیمان خوارد کە نایاب بوو. دیمەنی چێشتخانەکە شایەنی هەموو شتێکە، زۆر سەرنجڕاکێشە. بە دڵنیاییەوە دەگەڕێمەوە و پێشنیاری دەکەم.", imageSrc: "http://img.b2bpic.net/free-photo/couple-having-date-together-luxurious-restaurant_23-2150517423.jpg", imageAlt: "Customer Faryal Minhas"}, { - id: "2", name: "Black Pearl", handle: "@BlackPearl", testimonial: "I went to Obaw Restaurant for breakfast. The view of Rawanduz was amazing, and the place had a great atmosphere. The food was delicious, but it took a while to be served. Still, I enjoyed my time there.", imageSrc: "http://img.b2bpic.net/free-photo/group-young-people-enjoying-dinner-together_23-2148454092.jpg", imageAlt: "Customer Black Pearl"}, + id: "2", name: "Black Pearl", handle: "@BlackPearl", testimonial: "بۆ نانی بەیانی چوومە چێشتخانەی ئۆباو. دیمەنی ڕەواندز سەرسوڕهێنەر بوو، و شوێنەکە کەشێکی خۆشی هەبوو. خواردنەکە بەتام بوو، بەڵام کەمێک کاتی ویست تا پێشکەش کرا. هێشتا، کاتێکی خۆشم لەوێ بەسەر برد.", imageSrc: "http://img.b2bpic.net/free-photo/group-young-people-enjoying-dinner-together_23-2148454092.jpg", imageAlt: "Customer Black Pearl"}, { - id: "3", name: "Hoshang Kanabi", handle: "@HoshangK", testimonial: "This restaurant offers an incredible dining experience with a breathtaking view of the Rwanduz Canyon. We visited for breakfast, and it was excellent. The best part? It only cost 12,000 IQD for breakfast for two people—great value for such a wonderful setting!", imageSrc: "http://img.b2bpic.net/free-photo/portrait-smiling-young-professional-male-chef-with-his-prepared-dish_23-2147863802.jpg", imageAlt: "Customer Hoshang Kanabi"}, + id: "3", name: "Hoshang Kanabi", handle: "@HoshangK", testimonial: "ئەم چێشتخانەیە ئەزموونێکی نایابی نانخواردن پێشکەش دەکات لەگەڵ دیمەنێکی سەرنجڕاکێشی کانی ڕەواندز. ئێمە بۆ نانی بەیانی سەردانمان کرد، و نایاب بوو. باشترین بەش؟ تەنها 12,000 دیناری عێراقی تێچوو بۆ نانی بەیانی دوو کەس – نرخێکی زۆر باشە بۆ شوێنێکی بەم شێوەیە جوان!", imageSrc: "http://img.b2bpic.net/free-photo/portrait-smiling-young-professional-male-chef-with-his-prepared-dish_23-2147863802.jpg", imageAlt: "Customer Hoshang Kanabi"}, { - id: "4", name: "Sarah J.", handle: "@SarahJ", testimonial: "The ambiance at Obaw Restaurant is simply enchanting. Every dish was a masterpiece, beautifully presented and bursting with flavor. A truly memorable dining experience!", imageSrc: "http://img.b2bpic.net/free-photo/couple-with-delicious-drinks-high-angle_23-2150124832.jpg", imageAlt: "Customer Sarah J."}, + id: "4", name: "Sarah J.", handle: "@SarahJ", testimonial: "کەشوهەوای چێشتخانەی ئۆباو سادە و دڵڕفێنە. هەر خواردنێک شاکارێک بوو، بە جوانی پێشکەش کرابوو و پڕ بوو لە تام. ئەزموونێکی نانخواردنی بەڕاستی لەبیرنەکراو!", imageSrc: "http://img.b2bpic.net/free-photo/couple-with-delicious-drinks-high-angle_23-2150124832.jpg", imageAlt: "Customer Sarah J."}, { - id: "5", name: "Ahmad R.", handle: "@AhmadR", testimonial: "From the moment we arrived, the service was impeccable. The staff were attentive and knowledgeable, and the traditional Kurdish dishes were exquisite. Highly recommended!", imageSrc: "http://img.b2bpic.net/free-photo/cook-with-pasta-dish_1154-135.jpg", imageAlt: "Customer Ahmad R."}, + id: "5", name: "Ahmad R.", handle: "@AhmadR", testimonial: "لە یەکەم ساتەوە کە گەیشتین، خزمەتگوزاری بێ کەموکوڕی بوو. ستافەکە سەرنجڕاکێش و زانیاریان هەبوو، و خواردنە کوردییە نەریتییەکان نایاب بوون. زۆر پێشنیار دەکرێت!", imageSrc: "http://img.b2bpic.net/free-photo/cook-with-pasta-dish_1154-135.jpg", imageAlt: "Customer Ahmad R."}, ]} - title="What Our Cherished Guests Say" - description="Hear directly from those who have experienced the magic of Obaw Restaurant. Their words are a testament to our dedication to culinary excellence and warm service." + title="گوتمانی میوانە خۆشەویستەکانمان" + description="ڕاستەوخۆ لەو کەسانەوە ببیستە کە ئەزموونی جادووی چێشتخانەی ئۆباویان کردووە. قسەکانیان بەڵگەیە لەسەر پابەندبوونمان بە باشترین چێشتلێنان و خزمەتگوزاری گەرم." speed={60} topMarqueeDirection="right" /> @@ -197,37 +197,37 @@ export default function LandingPage() {
@@ -236,42 +236,42 @@ export default function LandingPage() { logoText="Obaw Restaurant" columns={[ { - title: "Quick Links", items: [ + title: "بەستەری خێرا", items: [ { - label: "Home", href: "#hero"}, + label: "ماڵەوە", href: "#hero"}, { - label: "About Us", href: "#about"}, + label: "دەربارەی ئێمە", href: "#about"}, { - label: "Menu", href: "#menu"}, + label: "لیستەی خواردن", href: "#menu"}, { - label: "Gallery", href: "#gallery"}, + label: "پێشانگا", href: "#gallery"}, ], }, { - title: "Support", items: [ + title: "پشتگیری", items: [ { - label: "Reservations", href: "#contact"}, + label: "گرتنی مێز", href: "#contact"}, { - label: "Contact Us", href: "#contact"}, + label: "پەیوەندی بە ئێمەوە بکە", href: "#contact"}, { - label: "FAQ", href: "#"}, + label: "پرسیارە باوەکان", href: "#"}, ], }, { - title: "Follow Us", items: [ + title: "دوامان بکەوە", items: [ { - label: "Instagram", href: "https://instagram.com/obawrestaurant"}, + label: "ئینستاگرام", href: "https://instagram.com/obawrestaurant"}, { - label: "Facebook", href: "https://facebook.com/obawrestaurant"}, + label: "فەیسبووک", href: "https://facebook.com/obawrestaurant"}, { - label: "Twitter", href: "https://twitter.com/obawrestaurant"}, + label: "تویتەر", href: "https://twitter.com/obawrestaurant"}, ], }, ]} - copyrightText="© 2024 Obaw Restaurant. All rights reserved." + copyrightText="© 2024 چێشتخانەی ئۆباو. هەموو مافەکانی پارێزراون." /> ); -} +} \ No newline at end of file From 6689daf06dc2d97fd1d168b1490960f4c053388c Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 10 Jun 2026 07:43:35 +0000 Subject: [PATCH 3/3] Add src/components/LanguageSwitcher.tsx --- src/components/LanguageSwitcher.tsx | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/components/LanguageSwitcher.tsx diff --git a/src/components/LanguageSwitcher.tsx b/src/components/LanguageSwitcher.tsx new file mode 100644 index 0000000..de6f004 --- /dev/null +++ b/src/components/LanguageSwitcher.tsx @@ -0,0 +1,33 @@ +"use client"; + +import React from "react"; +import { useLang } from "@/app/langContext"; + +const LanguageSwitcher: React.FC = () => { + const { lang, setLanguage } = useLang(); + + return ( +
+ + +
+ ); +}; + +export default LanguageSwitcher; \ No newline at end of file