Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tr added #49

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion next-i18next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
i18n: {
defaultLocale: "en",
locales: ["en", "ar", "tr"],
locales: ["en", "tr"],
},
};
3 changes: 0 additions & 3 deletions public/locales/ar/common.json

This file was deleted.

14 changes: 14 additions & 0 deletions public/locales/en/addmeal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"fried-chips": "Fried Chips",
"dietary": "Dietary",
"vegeterian": "Vegetarian",
"vegan": "Vegan",
"gluten-free": "Gluten free",
"ingredients": "Ingredients",
"tomatoes": "Tomatoes",
"delivery": "Delivery in",
"price": "Price",
"howmuch": "$30",
"time": "30 min",
"save": "Save"
}
7 changes: 7 additions & 0 deletions public/locales/en/cards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"card-title": "You've missed homemade food?",
"card-subtitle": "Pick your favorite chef, food or cuisine.",
"card1-text": "order the food and get it when you want",
"card2-text": "Get a 15% discount for your first order!",
"card2-btn": "Order Now"
}
18 changes: 18 additions & 0 deletions public/locales/en/create-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"create-account": "Create an Account",
"firstname": "First Name",
"lastname": "Last Name",
"password": "Password",
"email": "Email",
"area-code": "Area Code",
"phone": "Phone Number",
"adress": "Adress",
"zip-code": "ZIP Code",
"city": "City",
"country": "Country",
"terms-conditions": "I agree to Terms and Conditions ",
"cancel": "Cancel",
"have-account": "Already Have An Account?",
"register-btn": "Register",
"signin": "Sign In"
}
7 changes: 7 additions & 0 deletions public/locales/en/edit-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"account": "Edit Account",
"phone-num": "Phone Number",
"old-password": "Old Password",
"new-password": "New Password",
"save-btn": "Save"
}
11 changes: 11 additions & 0 deletions public/locales/en/footer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"help": "Get help",
"chef": "Become a chef",
"promotions": "Promotions",
"about": "About Cookiez",
"chef-around": " Chefs near me",
"view-foods": "View all home made foods",
"view-cities": "View all cities",
"view-chefs": "View all chefs",
"copyright": "Cookiez Copyright 2022"
}
6 changes: 6 additions & 0 deletions public/locales/en/hero.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": " Fast delivery, delicious and cheaper",
"subtitle": "Find your favorite food and order in seconds",
"placeholder": "Enter a food name or location",
"search-button": "Find"
}
6 changes: 6 additions & 0 deletions public/locales/en/landing-meals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"search": "Search",
"categories": "Categories",
"spanish-paella": "Spanish Paella",
"price": "$6"
}
9 changes: 9 additions & 0 deletions public/locales/en/navbar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"signup": "Sign Up",
"login": "Login",
"add-new-food": " Add a new food",
"dashboard": "Dashboard",
"account-settings": "Account Settings",
"logout": "Logout",
"name": "{{name}}"
}
24 changes: 24 additions & 0 deletions public/locales/en/order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"orders": "Orders",
"settings": "Payment settings",
"reviews": "Customer reviews",
"total": "Total orders",
"revenue": "Revenue",
"popular": "Popular orders",
"filter": "Filter",
"search": "Search by food name",
"date-btn": "Date range",
"status-btn": "Status",
"payment-btn": "Payment method",
"ref": "Ref.",
"date": "DATE",
"customer": "CUSTOMER",
"food": "FOOD",
"status": "STATUS",
"payment": "PAYMENT",
"price": "PRICE",
"fried-chips": "Fried Chips",
"sausage": "Sausage",
"preparing": "Preparing",
"credit-card": "Credit Card"
}
8 changes: 8 additions & 0 deletions public/locales/en/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profile": "Profile",
"listed-foods": "Listed foods",
"orders": "Orders",
"payment-settings": "Payment settings",
"edit-profile": "Edit profile",
"logout": "Logout"
}
5 changes: 5 additions & 0 deletions public/locales/en/search-cities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Places where Cookiez is available",
"text": "We are currently providing services for limited cities. We plan to expand services across whole country very soon.Enter a city name",
"placeholder": "Enter a city name"
}
14 changes: 14 additions & 0 deletions public/locales/tr/addmeal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"fried-chips": "Kızarmış Patates",
"dietary": "Diyet",
"vegeterian": "Vejeteryan",
"vegan": "Vegan",
"gluten-free": "Glutensiz",
"ingredients": "Malzemeler",
"tomatoes": "Domates",
"delivery": "Teslimat",
"price": "Fiyat",
"howmuch": "3 tl",
"time": "30 dk",
"save": "Kaydet"
}
7 changes: 7 additions & 0 deletions public/locales/tr/cards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"card-title": "Ev yapımı yemekleri özlemedin mi?",
"card-subtitle": "Favori şefini, yemeğini veya mutfağını seç",
"card1-text": "Şefini seç ,yemeğini sipariş et ve anında kapında olsun",
"card2-text": "İlk siparişinde %15 indirimi kap!",
"card2-btn": "Sipariş Ver"
}
18 changes: 18 additions & 0 deletions public/locales/tr/create-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"create-account": "Hesap Oluştur",
"firstname": "İsim",
"lastname": "Soyisim",
"password": "Şifre",
"email": "Mail Adresi",
"adress": "Adres",
"area-code": "Alan Kodu",
"phone": "Telefon Numarası",
"zip-code": "Posta Kodu",
"city": "Şehir",
"country": "Ülke",
"terms-conditions": "Hüküm ve Koşulları kabul ediyorum ",
"cancel": "İptal",
"have-account": "Hesabın Var Mı?",
"register-btn": "Kayıt Ol",
"signin": "Giriş Yap"
}
7 changes: 7 additions & 0 deletions public/locales/tr/edit-account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"account": "Hesap Yenileme",
"phone-num": "Telefon Numarası",
"old-password": "Eski Şifre",
"new-password": "Yeni Şifre",
"save-btn": "Kaydet"
}
11 changes: 11 additions & 0 deletions public/locales/tr/footer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"help": "Yardım al",
"chef": "Şef ol",
"promotions": "Promosyonlar",
"about": "Cookiez hakkında",
"chef-around": "Yakınlarımdaki şefler ",
"view-foods": "Tüm ev yapımı yemekleri görüntüle",
"view-cities": "Tüm şehirleri görüntüle",
"view-chefs": "Tüm şefleri görüntüle",
"copyright": "Cookiez Copyright 2022"
}
6 changes: 6 additions & 0 deletions public/locales/tr/hero.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Lezzetli, ucuz ve hızlı teslimat",
"subtitle": "Favori yemeğini bul ve saniyeler içinde sipariş et",
"placeholder": "Yemek ismi veya konumunu gir",
"search-button": "Ara"
}
6 changes: 6 additions & 0 deletions public/locales/tr/landing-meals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"search": "Ara",
"categories": "Kategoriler",
"spanish-paella": "İspanyol Paella",
"price": "60 tl"
}
9 changes: 9 additions & 0 deletions public/locales/tr/navbar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"signup": "Kayıt OL",
"login": "Giriş Yap",
"add-new-food": " Yeni Yemek Ekle",
"dashboard": "Profil",
"account-settings": "Hesap Ayarları",
"logout": "Çıkış",
"name": "{{isim}}"
}
25 changes: 25 additions & 0 deletions public/locales/tr/order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"orders": "Siparişler",
"payment-settings": "Ödeme ayarları",
"customer-reviews": "Müşteri yorumları",
"logout": "Çıkış",
"total": "Toplam siparişler",
"revenue": "Kazanç",
"popular": "Popüler siparişler",
"filter": "Filtrele",
"search": "Yemek ismiyle ara",
"date-btn": "Tarih aralığı",
"status-btn": "Sipariş durumu",
"payment-btn": "Ödeme yöntemi",
"ref": "Referans",
"date": "Tarih",
"customer": "Müşteri",
"food": "Yemek",
"status": "Sipariş durumu",
"payment": "Ödeme",
"price": "Fiyat",
"fried-chips": "Kızarmış Patates",
"sausage": "Sosis",
"preparing": "Hazırlanıyor",
"credit-card": "Kredi Kartı"
}
8 changes: 8 additions & 0 deletions public/locales/tr/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profile": "Profil",
"listed-foods": "Listelenmiş Yemekler",
"orders": "Siparişler",
"payment-settings": "Ödeme Ayarları",
"edit-profile": "Profili Düzenle",
"logout": "Çıkış"
}
5 changes: 5 additions & 0 deletions public/locales/tr/search-cities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Cookiez'in hizmet verdiği yerler",
"text": "Şuan sınırlı şehirde hizmet veriyoruz. Yakında tüm ülkede hizmet vermeyi planlıyoruz.",
"placeholder": "Bir şehir ismi gir"
}
34 changes: 22 additions & 12 deletions src/components/AddMeal/AddMeal.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useTranslation } from "next-i18next";
import { useState } from "react";
import { HiPlusCircle } from "react-icons/hi";
import { IoAddCircleOutline, IoTrashBinOutline } from "react-icons/io5";

export default function AddMeal() {
const [mealImage, setMealImage] = useState("../images/header.jpg");
const [mealName, setMealName] = useState("");
Expand Down Expand Up @@ -37,6 +39,8 @@ export default function AddMeal() {
isGlutenFree(!glutenFree);
glutenFree ? setDietary([...dietary, "gluten free"]) : null;
}
const { t } = useTranslation("addmeal");

return (
<div className='flex h-fit w-[340px] flex-col items-start justify-start gap-3 overflow-hidden'>
<div
Expand Down Expand Up @@ -81,15 +85,15 @@ export default function AddMeal() {

<input
type='text'
placeholder='Fried Chips'
placeholder={t("fried-chips")}
className='lg:text-base ml-5 w-2/3 rounded border-none bg-[#00494533] text-center text-sm focus:ring-1 focus:ring-[#004945]'
required
value={mealName}
onChange={(e) => {
setMealName(e.target.value);
}}
/>
<p className='lg:text-base ml-3 text-sm'>Dietary</p>
<p className='lg:text-base ml-3 text-sm'> {t("dietary")}</p>
<ul className='ml-5 flex w-full items-center justify-start gap-3'>
<li>
<input
Expand All @@ -104,7 +108,9 @@ export default function AddMeal() {
className='inline-flex w-full cursor-pointer items-center justify-between rounded-full bg-[#00494533] p-1 ring-1 ring-[#00494533] peer-checked:ring-[#004945]'
>
<div className='block'>
<div className='w-full text-xs '>Vegetarian</div>
<div className='w-full text-xs '>
{t("vegeterian")}
</div>
</div>
</label>
</li>
Expand All @@ -120,7 +126,7 @@ export default function AddMeal() {
className='inline-flex w-full cursor-pointer items-center justify-between rounded-full bg-[#00494533] p-1 ring-1 ring-[#00494533] peer-checked:ring-[#004945]'
>
<div className='block'>
<div className='w-full text-xs'>Vegan</div>
<div className='w-full text-xs'>{t("vegan")}</div>
</div>
</label>
</li>
Expand All @@ -136,18 +142,20 @@ export default function AddMeal() {
className='inline-flex w-full cursor-pointer items-center justify-between rounded-full bg-[#00494533] p-1 ring-1 ring-[#00494533] peer-checked:ring-[#004945]'
>
<div className='block'>
<div className='w-full text-xs'>Gluten Free</div>
<div className='w-full text-xs'>
{t("gluten-free")}
</div>
</div>
</label>
</li>
</ul>

<p className='lg:text-base ml-3 text-sm'>Ingredients</p>
<p className='lg:text-base ml-3 text-sm'>{t("ingredients")}</p>
<div className='ml-5 flex w-full flex-col items-start justify-start gap-3'>
<div className='relative w-1/3'>
<input
type='text'
placeholder='Tomatoes'
placeholder={t("tomatoes")}
value={ingredient}
className=' lg:text-sm w-full rounded-full border-none bg-[#00494533] p-2 text-start text-xs focus:ring-1 focus:ring-[#004945]'
onChange={(e) => setIngredient(e.target.value)}
Expand All @@ -173,19 +181,21 @@ export default function AddMeal() {
))}
</div>
</div>
<p className='lg:text-base ml-3 text-sm'>Delivery in</p>
<p className='lg:text-base ml-3 text-sm'>{t("delivery")}</p>
<input
type='text'
value={deliveryMin}
className='lg:text-base ml-5 rounded border-none text-xs ring-1 ring-[#004945] focus:rounded focus:ring-1 focus:ring-[#004945]'
placeholder='30 min'
placeholder={t("time")}
onChange={(e) => setDeliveryMin(e.target.value)}
></input>

<p className='lg:text-base ml-3 text-sm'>Price</p>
<p className='lg:text-base ml-3 text-sm'>{t("price")}</p>
<input
type='text'
value={price}
className='lg:text-base ml-5 mb-3 rounded border-none text-xs ring-1 ring-[#004945] focus:rounded focus:ring-1 focus:ring-[#004945]'
placeholder='30 dollar'
placeholder={t("howmuch")}
onChange={(e) => setPrice(e.target.value)}
></input>

Expand All @@ -195,7 +205,7 @@ export default function AddMeal() {
}}
className=' absolute bottom-80 right-0 mr-2 rounded bg-[#004945] px-6 py-1 text-white'
>
Save
{t("save")}
</button>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from "react";
import renderer from "react-test-renderer";

import AddMeal from "../AddMeal";
import AddMeal from "@/components/AddMeal/AddMeal";

// eslint-disable-next-line no-undef
it("renders correctly", () => {
// eslint-disable-next-line
it("Dashboard Component", () => {
const tree = renderer.create(<AddMeal />).toJSON();
// eslint-disable-next-line no-undef
expect(tree).toMatchSnapshot();
Expand Down
Loading