diff --git a/components/AppHeader/page.jsx b/components/AppHeader/page.jsx index a5e5417..d7caa3d 100644 --- a/components/AppHeader/page.jsx +++ b/components/AppHeader/page.jsx @@ -36,6 +36,7 @@ const AppHeader = ({ const notifUnreadData = CTX.state.notifUnreadData; const t = useTranslations("login"); + const t2 = useTranslations("extra"); const locale = useLocale(); const isRTL = locale === "fa"; @@ -172,7 +173,7 @@ const AppHeader = ({ {logOut && (
{ toast.error(`برای خروج نگه دارید`, { position: "bottom-right", @@ -180,7 +181,7 @@ const AppHeader = ({ }); }} > -

خروج

+

{t2("exit")}

)} {icon1 ? ( @@ -212,7 +213,7 @@ const AppHeader = ({ {notif && ( {notifUnreadData > 0 && ( -
+
)} diff --git a/components/landingComponents/AboutUsHero/page.jsx b/components/landingComponents/AboutUsHero/page.jsx deleted file mode 100644 index 12dfc32..0000000 --- a/components/landingComponents/AboutUsHero/page.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; - -const AboutUsHero = () => { - return ( - <> -
-
-

- Welcome to Briz -

-
-
- - ); -}; - -export default AboutUsHero; diff --git a/components/landingComponents/Navbar.jsx b/components/landingComponents/Navbar.jsx index d05e7ac..8b54a23 100644 --- a/components/landingComponents/Navbar.jsx +++ b/components/landingComponents/Navbar.jsx @@ -77,7 +77,7 @@ const Navbar = () => { // Function to change the locale const changeLocale = (newLocale) => { // Navigate to the same route but with a different locale - router.push(newLocale); + router.push(`/${newLocale}`); setIsOpenLang(false); // Close the dropdown }; @@ -120,7 +120,7 @@ const Navbar = () => { {nav.go ? ( {nav.title} ) : ( - {nav.title} + {nav.title} )} @@ -195,7 +195,7 @@ const Navbar = () => { {nav.go ? ( {nav.title} ) : ( - {nav.title} + {nav.title} )} diff --git a/messages/en.json b/messages/en.json index 26aa389..8d05e99 100644 --- a/messages/en.json +++ b/messages/en.json @@ -151,6 +151,17 @@ "signUpButton": "Verification of information" }, + "aboutUs": { + "title": "Welcome to Briz", + "p1": "At Briz, we envision each coffee shop as a symphony, with every element from the espresso shot to the customer service playing in perfect harmony. Our journey began with the coming together of two innovative startups: 'Tuk Coffee,' a renowned delivery platform for brewed coffee with physical branches, and 'Igarson,' an accounting application tailored for coffee shops and restaurants. Our combined experience and passion for coffee shop excellence are the foundation of Briz.", + "t2": "Our Team's Heritage", + "p2": "Our team consists of six dedicated members, each bringing a unique blend of expertise and innovation from our roots in 'Tuk Coffee' and 'Igarson.' We are baristas, managers, tech enthusiasts, and, above all, coffee lovers. Together, we've seen the challenges and triumphs of running coffee shops, and it's this rich experience that fuels our commitment to making Briz the ace of your coffee shop orchestr", + "t3": "Our Team's Heritage", + "p3": "We believe in the power of an efficiently managed coffee shop - where every task, every role, and every shift contributes to the delightful crescendo of customer satisfaction. Briz is not just an app; it's your partner in achieving this efficiency. It's the conductor's baton that helps you lead your coffee shop's symphony to play more harmoniously than ever before. With Briz, you're not just managing; you're performing. ", + "t4": "Our Commitment to Your Coffee Shop", + "p4": "Our mission is simple yet ambitious: to empower coffee shops to manage their spaces with unprecedented efficiency and insight. Whether it's the bustling rush of the morning crowd or the relaxed ambiance of late evenings, Briz is there to ensure that every note of your coffee shop's day is pitch-perfect. Join us in redefining what it means to run a coffee shop, and let's make every cup of coffee an experience to remember." + }, + "homePage": { "activityText": " activities today", "shiftText": " shifts today", @@ -276,5 +287,26 @@ "staffsTitle": " Management of staffs", "shiftsTitle": "Management of shifts", "taskTitle": "Add a task" + }, + + "tasks": { + "title": "Collection activity management ", + "subTitle": "Activity Management", + "filter": "Filter", + "specialDay": "Special Day", + "priority": "Priority" + }, + "account": { + "title": "", + "subTitle": "", + "firstName": "First name", + "lastName": "Last name", + "phoneNumber": "Phone number", + "language": "Language" + }, + "extra": { + "noting": "Nothing found", + "loading": "Please wait", + "exit": "log out" } } diff --git a/messages/fa.json b/messages/fa.json index 6816ede..2aa3e36 100644 --- a/messages/fa.json +++ b/messages/fa.json @@ -149,6 +149,16 @@ "signUpComplexAddressInput": "آدرس", "signUpButton": "تأیید اطلاعات" }, + "aboutUs": { + "title": "به بریز خوش آمدید", + "p1": "در بریز، ما هر کافه را مانند یک سمفونی می‌بینیم که هر عنصر، از شات اسپرسو تا خدمات مشتری، در هماهنگی کامل نواخته می‌شود. سفر ما با ادغام دو استارتاپ نوآورانه آغاز شد: «توک کافی»، یک پلتفرم تحویل قهوه با شعب فیزیکی، و «ای‌گارسان»، یک برنامه حسابداری مخصوص کافه‌ها و رستوران‌ها. تجربه و اشتیاق مشترک ما به کمال در کافه‌داری، پایه و اساس بریز است.", + "t2": "میراث تیم ما", + "p2": "تیم ما از شش عضو متعهد تشکیل شده است که هرکدام ترکیبی از تخصص و نوآوری را از ریشه‌های ما در «توک کافی» و «ای‌گارسان» به ارمغان آورده‌اند. ما باریستاها، مدیران، علاقه‌مندان به فناوری، و بالاتر از همه، عاشقان قهوه هستیم. با هم، چالش‌ها و موفقیت‌های مدیریت کافه‌ها را تجربه کرده‌ایم و این تجربه غنی ما را متعهد به ساختن بریز به عنوان بهترین ابزار برای مدیریت کافه شما کرده است.", + "t3": "میراث تیم ما", + "p3": "ما به قدرت مدیریت کارآمد یک کافه باور داریم - جایی که هر وظیفه، هر نقش و هر شیفت به کرشندوی دلنشین رضایت مشتری کمک می‌کند. بریز فقط یک اپلیکیشن نیست؛ شریک شما برای دستیابی به این بهره‌وری است. این باتوم رهبر ارکستری است که به شما کمک می‌کند سمفونی کافه خود را هماهنگ‌تر از همیشه اجرا کنید. با بریز، شما فقط مدیریت نمی‌کنید؛ شما اجرا می‌کنید.", + "t4": "تعهد ما به کافه شما", + "p4": "ماموریت ما ساده اما بلندپروازانه است: توانمندسازی کافه‌ها برای مدیریت فضاهای خود با کارایی و بصیرت بی‌سابقه. چه شلوغی صبحگاهی باشد، چه آرامش عصرگاهی، بریز در کنار شماست تا هر لحظه از روز کافه شما در بهترین حالت ممکن باشد. به ما بپیوندید تا معنای جدیدی به مدیریت کافه بدهیم و هر فنجان قهوه را به تجربه‌ای به یادماندنی تبدیل کنیم." + }, "homePage": { "activityText": " فعالیت امروز", "shiftText": " شیفت امروز", @@ -273,5 +283,25 @@ "staffsTitle": "مدیریت کارکنان", "shiftsTitle": "مدیریت شیفت‌ها", "taskTitle": "افزودن وظیفه" + }, + "tasks": { + "title": "مدیریت فعالیت جمع‌آوری", + "subTitle": "مدیریت فعالیت", + "filter": "فیلتر", + "specialDay": "روز ویژه", + "priority": "اولویت" + }, + "account": { + "title": "", + "subTitle": "", + "firstName": "نام", + "lastName": "نام خانوادگی", + "phoneNumber": "شماره تلفن", + "language": "زبان" + }, + "extra": { + "noting": "چیزی یافت نشد", + "loading": "لطفا صبر کنید", + "exit": "خروج" } } diff --git a/messages/zh.json b/messages/zh.json index 2383d93..559bc69 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -149,6 +149,16 @@ "signUpComplexAddressInput": "地址", "signUpButton": "验证信息" }, + "aboutUs": { + "title": "欢迎来到Briz", + "p1": "在Briz,我们将每家咖啡店视为一场交响乐,每个元素,从浓缩咖啡到客户服务,都在完美的和谐中演奏。我们的旅程始于两个创新初创公司的结合:“Tuk Coffee”,一个知名的现煮咖啡配送平台并拥有实体店;以及“Igarson”,一个专为咖啡馆和餐厅设计的会计应用程序。我们的丰富经验和对咖啡馆卓越的热情构成了Briz的基石。", + "t2": "我们团队的传承", + "p2": "我们的团队由六名敬业成员组成,他们从“Tuk Coffee”和“Igarson”带来了独特的专业知识和创新精神。我们是咖啡师、管理者、科技爱好者,更是热爱咖啡的人。我们共同经历了咖啡馆运营的挑战和成功,这种丰富的经验驱动我们致力于让Briz成为您的咖啡馆管理王牌。", + "t3": "我们团队的传承", + "p3": "我们相信高效管理咖啡馆的力量——每项任务、每个角色、每个班次都为顾客满意的美妙高潮贡献力量。Briz不仅仅是一个应用程序;它是您实现效率的伙伴。它是指挥棒,帮助您带领咖啡馆的交响乐更加和谐地演奏。有了Briz,您不仅是在管理;您是在表演。", + "t4": "我们对您咖啡馆的承诺", + "p4": "我们的使命既简单又雄心勃勃:赋能咖啡馆以前所未有的效率和洞察力管理空间。无论是早晨的忙碌高峰,还是傍晚的悠闲氛围,Briz都在您身边,确保咖啡馆一天中的每一个时刻都如同音符般完美无缺。加入我们,重新定义咖啡馆运营的意义,让每杯咖啡都成为值得回味的体验。" + }, "homePage": { "activityText": " 今日活动", "shiftText": " 今日班次", @@ -273,5 +283,26 @@ "staffsTitle": "员工管理", "shiftsTitle": "班次管理", "taskTitle": "添加任务" + }, + + "tasks": { + "title": "收集活动管理", + "subTitle": "活动管理", + "filter": "筛选", + "specialDay": "特殊日", + "priority": "优先级" + }, + "account": { + "title": "", + "subTitle": "", + "firstName": "名字", + "lastName": "姓氏", + "phoneNumber": "电话号码", + "language": "语言" + }, + "extra": { + "noting": "没有找到任何内容", + "loading": "请稍等", + "exit": "离开" } } diff --git a/package.json b/package.json index d7645c4..a527740 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,6 @@ "devDependencies": { "css-loader": "^6.8.1", "webpack": "^5.89.0" - } + }, + "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387" } diff --git a/plugins/Input/page.jsx b/plugins/Input/page.jsx index 09c776e..e1bfd35 100644 --- a/plugins/Input/page.jsx +++ b/plugins/Input/page.jsx @@ -34,7 +34,9 @@ const Input = ({ type="text" className={`peer w-full border-b placeholder:text-transparent relative rtl !text-sm ${ theme == 1 ? "form-control-white" : "form-control" - } ${isRTL ? "!text-right" : "!text-left"}`} + } ${isRTL ? "!text-right" : "!text-left"} ${ + readOnly ? "!bg-gray-50 opacity-50" : "" + }`} placeholder={name} disabled={disabled ? true : false} readOnly={readOnly ? true : false} @@ -48,7 +50,7 @@ const Input = ({ theme == 1 ? "form-control-white" : "form-control" } ${style ? style : ""} relative ${ isRTL ? "!text-right" : "!text-left" - }`} + }${readOnly ? "!bg-gray-50 opacity-50" : ""}`} placeholder={name} disabled={disabled ? true : false} readOnly={readOnly ? true : false} @@ -78,7 +80,7 @@ const Input = ({ theme == 1 ? "form-control-white" : "form-control" } ${style ? style : ""} relative ${ isRTL ? "!text-right" : "!text-left" - }`} + } ${readOnly ? "!bg-gray-50 opacity-50" : ""}`} placeholder={name} disabled={disabled ? true : false} readOnly={readOnly ? true : false} diff --git a/plugins/Loading/page.jsx b/plugins/Loading/page.jsx index 5b52ff1..9249477 100644 --- a/plugins/Loading/page.jsx +++ b/plugins/Loading/page.jsx @@ -3,10 +3,14 @@ import React, { useContext } from "react"; import AppContext from "@ctx/AppContext"; import gif from "@img/loading.gif"; import Image from "next/image"; +import { useLocale, useTranslations } from "next-intl"; const Loading = ({ rateId }) => { const CTX = useContext(AppContext); const loading = CTX.state.loading; + const t = useTranslations("extra"); + const locale = useLocale(); + const isRTL = locale === "fa"; return ( <> @@ -16,7 +20,7 @@ const Loading = ({ rateId }) => { } `} >
-

لطفا صبر کنید

+

{t("loading")}

diff --git a/plugins/NothingFound/page.jsx b/plugins/NothingFound/page.jsx index d225a45..742df6b 100644 --- a/plugins/NothingFound/page.jsx +++ b/plugins/NothingFound/page.jsx @@ -1,10 +1,14 @@ +import { useLocale, useTranslations } from "next-intl"; import React from "react"; const NothingFound = () => { + const t = useTranslations("extra"); + const locale = useLocale(); + const isRTL = locale === "fa"; return (
-

چیزی یافت نشد.

+

{t("noting")}

); diff --git a/src/app/[locale]/about-us/page.jsx b/src/app/[locale]/about-us/page.jsx index ce973c0..e8a5383 100644 --- a/src/app/[locale]/about-us/page.jsx +++ b/src/app/[locale]/about-us/page.jsx @@ -2,68 +2,57 @@ import Navbar from "@comp/landingComponents/Navbar"; import Footer from "@comp/landingComponents/Footer/page"; import React from "react"; -import AboutUsHero from "@comp/landingComponents/AboutUsHero/page"; +import { useLocale, useTranslations } from "next-intl"; // import ig from "../../../public/images/ig.png"; // import tuk from "../../../public/images/tuk.png"; // import Image from "next/image"; const AboutUs = () => { + const t = useTranslations("aboutUs"); + const locale = useLocale(); + const isRTL = locale === "fa"; return (
- +
+
+

+ {t("title")}{" "} +

+
+
-
+

- At Briz, we envision each coffee shop as a symphony, with every - element from the espresso shot to the customer service playing in - perfect harmony. Our journey began with the coming together of two - innovative startups: 'Tuk Coffee,' a renowned delivery platform for - brewed coffee with physical branches, and 'Igarson,' an accounting - application tailored for coffee shops and restaurants. Our combined - experience and passion for coffee shop excellence are the foundation - of Briz. + {t("p1")}{" "}

- Our Team's Heritage + {t("t2")}{" "}

- Our team consists of six dedicated members, each bringing a unique - blend of expertise and innovation from our roots in 'Tuk Coffee' and - 'Igarson.' We are baristas, managers, tech enthusiasts, and, above - all, coffee lovers. Together, we've seen the challenges and triumphs - of running coffee shops, and it's this rich experience that fuels our - commitment to making Briz the ace of your coffee shop orchestr + {t("p2")}{" "}

- Our Team's Heritage + {t("t3")}{" "}

- We believe in the power of an efficiently managed coffee shop - where - every task, every role, and every shift contributes to the delightful - crescendo of customer satisfaction. Briz is not just an app; it's your - partner in achieving this efficiency. It's the conductor's baton that - helps you lead your coffee shop's symphony to play more harmoniously - than ever before. With Briz, you're not just managing; you're - performing. + {t("p3")}{" "}

- Our Commitment to Your Coffee Shop{" "} + {t("t4")}{" "}

- Our mission is simple yet ambitious: to empower coffee shops to manage - their spaces with unprecedented efficiency and insight. Whether it's - the bustling rush of the morning crowd or the relaxed ambiance of late - evenings, Briz is there to ensure that every note of your coffee - shop's day is pitch-perfect. Join us in redefining what it means to - run a coffee shop, and let's make every cup of coffee an experience to - remember. + {t("p4")}{" "}

{/*
diff --git a/src/app/[locale]/app/acount/page.jsx b/src/app/[locale]/app/acount/page.jsx index cc27bcf..e497674 100644 --- a/src/app/[locale]/app/acount/page.jsx +++ b/src/app/[locale]/app/acount/page.jsx @@ -10,6 +10,8 @@ import SimpleReactValidator from "simple-react-validator"; import DatePickerIran from "plugins/DatePickerIran/page"; import { useLongPress } from "@uidotdev/usehooks"; import GoBack from "plugins/GoBack/page"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useLocale, useTranslations } from "next-intl"; const page = () => { const CTX = useContext(AppContext); @@ -18,9 +20,16 @@ const page = () => { const [fistName, setFistName] = useState(""); const [lastName, setLastName] = useState(""); const [phoneNumber, setPhoneNumber] = useState(""); + const [lang, setLang] = useState(""); // const [nationalId, setNationalId] = useState(""); // const [birthDateTimeStamp, setBirthDateTimeStamp] = useState(""); const [, forceUpdate] = useState(); + const router = useRouter(); + const pathname = usePathname(); + const searchParams = useSearchParams(); + const t = useTranslations("account"); + const locale = useLocale(); + const isRTL = locale === "fa"; const validator = useRef( new SimpleReactValidator({ @@ -37,6 +46,52 @@ const page = () => { }) ); + const availableLocales = [ + { value: "en", key: "English" }, + { value: "fa", key: "فارسی" }, + { value: "zh", key: "中文" }, + ]; + + const detectLocale = () => { + const pathSegments = pathname.split("/").filter((segment) => segment); + + const firstSegment = pathSegments[0]; + const locale = availableLocales.find( + (locale) => locale.value === firstSegment + ); + return locale ? locale.value : "en"; + }; + + useEffect(() => { + const currentLocale = detectLocale(); + setLang(currentLocale); + + if (currentLocale === "fa") { + document.documentElement.dir = "rtl"; + } else { + document.documentElement.dir = "ltr"; + } + }, [pathname]); + + const changeLocale = (newLocale) => { + setLang(newLocale); + const pathSegments = pathname.split("/").filter((segment) => segment); + const currentLocale = detectLocale(); + + if (availableLocales.some((locale) => locale.value === pathSegments[0])) { + pathSegments[0] = newLocale; + } else { + pathSegments.unshift(newLocale); + } + + const newPath = + "/" + + pathSegments.join("/") + + (searchParams.toString() ? `?${searchParams.toString()}` : ""); + + router.push(newPath); + }; + useEffect(() => { // if (profile.birthDateTimeStamp < 0) { // return (date = moment @@ -119,7 +174,7 @@ const page = () => {
{ "required" )} theme={1} + readOnly={true} />
{ "required" )} theme={1} + readOnly={true} />
{ />
+
+ { + const selectedLang = e.target.value; + setLang(selectedLang); + changeLocale(selectedLang); + if (validator.current) { + validator.current.showMessageFor("lang"); + } + }} + style={lang === "fa" ? "text-right" : "text-left"} + validator={true} + validatorData={ + validator.current + ? validator.current.message("lang", lang, "required") + : "" + } + theme={1} + select={true} + selectData={availableLocales} + defaultValue="انتخاب کنید" + /> +
+ {/* setBirthDateTimeStamp(e)} date={birthDateTimeStamp} diff --git a/src/app/[locale]/app/home/page.jsx b/src/app/[locale]/app/home/page.jsx index 44e4ef1..1aa8f04 100644 --- a/src/app/[locale]/app/home/page.jsx +++ b/src/app/[locale]/app/home/page.jsx @@ -120,7 +120,7 @@ const Home = (props) => {
-

+

{isRTL ? ( { {isRTL ? ( ) : ( <> - + {" "} {homePageData?.totalShiftToday} diff --git a/src/app/[locale]/app/tasks/page.jsx b/src/app/[locale]/app/tasks/page.jsx index 29aa2f9..7a70b01 100644 --- a/src/app/[locale]/app/tasks/page.jsx +++ b/src/app/[locale]/app/tasks/page.jsx @@ -17,6 +17,7 @@ import Loading from "plugins/Loading/page"; import { useLongPress } from "@uidotdev/usehooks"; import BottomFilterActivities from "plugins/BottomSheet/BottomFilterActivities"; import NothingFound from "plugins/NothingFound/page"; +import { useLocale, useTranslations } from "next-intl"; const page = () => { const CTX = useContext(AppContext); @@ -32,6 +33,10 @@ const page = () => { const [activeStaffId, setActiveStaffId] = useState(-1); const [dateQueryFilterValue, setDateQueryFilterValue] = useState(1); + const t = useTranslations("tasks"); + const locale = useLocale(); + const isRTL = locale === "fa"; + const handleInfiniteNextFetchActivity = () => { CTX.setPageGetActivity((e) => e + 1); CTX.GetActivity( @@ -68,17 +73,13 @@ const page = () => { return (

- + -
+
{" "}
CTX.setBottomFilterActivitiesOpen(true)} >
@@ -95,14 +96,14 @@ const page = () => { />
-
+

- فیلــتر + {t("filter")}

-
+
{ />
-
+

- روز خاص + {t("specialDay")}{" "}

-
+
{ />
-
+

- اولویت + {t("priority")}