From 01e6d2e75548fdf5f32856e1dc124579b109138e Mon Sep 17 00:00:00 2001 From: kavehjamshidi Date: Wed, 1 Jun 2022 16:34:47 +0430 Subject: [PATCH] replaced k -> window.t(k) --- src/QRScan/LastQr/index.js | 24 +-- src/Redux/reducers/activation.js | 4 +- src/Redux/reducers/book.js | 34 ++--- src/Redux/reducers/comment.js | 2 +- src/Redux/reducers/public.js | 38 ++--- src/Redux/reducers/transport.js | 2 +- src/Redux/reducers/user.js | 4 +- src/Redux/reducers/userFactor.js | 4 +- src/Redux/reducers/userProduct.js | 2 +- src/views/AR/Item/index.js | 26 ++-- src/views/About/index.js | 28 ++-- src/views/Auth/Login/Cellphone/index.js | 6 +- src/views/Auth/Login/Code/index.js | 2 +- src/views/Auth/Profile/Birthdate/index.js | 12 +- src/views/Auth/Profile/Document/index.js | 4 +- src/views/Auth/Profile/Upload/index.js | 2 +- src/views/Auth/Profile/index.js | 116 +++++++------- src/views/Auth/Splash/index.js | 4 +- src/views/Callback/Status/index.js | 4 +- src/views/Cart/Table/index.js | 34 ++--- src/views/ChatList/Search/index.js | 4 +- src/views/ChatRoom/Body/Input/index.js | 2 +- .../ChatRoom/Body/Message/Comment/index.js | 14 +- .../ChatRoom/Body/Message/Inline/index.js | 2 +- .../Body/Message/MultiSelect/index.js | 2 +- .../ChatRoom/Body/Message/Normal/index.js | 14 +- src/views/ChatRoom/Body/index.js | 12 +- src/views/ChatRoom/Info/index.js | 18 +-- src/views/Checkout/Table/index.js | 32 ++-- src/views/Checkout/index.js | 24 +-- src/views/Contact/index.js | 12 +- src/views/Download/Item/index.js | 26 ++-- src/views/Download/index.js | 2 +- src/views/Faq/index.js | 4 +- src/views/Home/Footer/index.js | 24 +-- src/views/Home/HomeHeader/index.js | 2 +- src/views/Home/HomeScroll/index.js | 2 +- src/views/Home/HomeSearch/Select/index.js | 2 +- src/views/Home/HomeSearch/index.js | 8 +- src/views/Home/HomeSlider/Blog/index.js | 10 +- src/views/Home/HomeSlider/index.js | 8 +- src/views/Home/HomeStatic/Vitrin/index.js | 2 +- src/views/Home/HomeStatic/index.js | 4 +- src/views/Home/Membership/index.js | 6 +- src/views/Home/Navbar/Laptop/index.js | 14 +- .../Mobile/NavbarDrawer/NavbarDrawer.js | 64 ++++---- src/views/Home/Navbar/Mobile/index.js | 16 +- src/views/MyBooks/index.js | 26 ++-- src/views/MyBooks_old/index.js | 4 +- src/views/NewProfile/index.js | 144 +++++++++--------- src/views/Orders/index.js | 28 ++-- src/views/Product/AddToCart/index.js | 4 +- src/views/Product/Comment/index.js | 2 +- src/views/Product/Gallery/Modal/index.js | 4 +- src/views/Product/Gallery/index.js | 4 +- src/views/Product/MaterialModal/index.js | 2 +- src/views/Product/index.js | 44 +++--- src/views/Products/Filters/index.js | 4 +- src/views/Products/Product/index.js | 30 ++-- src/views/Products/Select/index.js | 6 +- src/views/Products/index.js | 8 +- src/views/QR/SubjectsDropdown/index.js | 10 +- src/views/QR/index.js | 26 ++-- src/views/QRScan/LastQr/index.js | 24 +-- src/views/QRScan/Modal/index.js | 8 +- src/views/Sample/index.js | 2 +- src/views/Support/Upload/index.js | 4 +- src/views/Support/index.js | 36 ++--- 68 files changed, 551 insertions(+), 551 deletions(-) diff --git a/src/QRScan/LastQr/index.js b/src/QRScan/LastQr/index.js index 3615974..06002dd 100644 --- a/src/QRScan/LastQr/index.js +++ b/src/QRScan/LastQr/index.js @@ -4,18 +4,18 @@ import { Link } from "react-router-dom"; import "./index.scss"; const grades = [ - "اول", - "دوم", - "سوم", - "چهارم", - "پنجم", - "ششم", - "هفتم", - "هشتم", - "نهم", - "دهم", - "یازدهم", - "دوازدهم", + window.t("اول"), + window.t("دوم"), + window.t("سوم"), + window.t("چهارم"), + window.t("پنجم"), + window.t("ششم"), + window.t("هفتم"), + window.t("هشتم"), + window.t("نهم"), + window.t("دهم"), + window.t("یازدهم"), + window.t("دوازدهم"), ]; export default function LastQR(props) { diff --git a/src/Redux/reducers/activation.js b/src/Redux/reducers/activation.js index 8164548..31ee33c 100644 --- a/src/Redux/reducers/activation.js +++ b/src/Redux/reducers/activation.js @@ -14,10 +14,10 @@ export default function activation(state = initialState, action) { case "activation/update": return { ...state, loading: false, error: null }; case "activation/updateStatus": - toast.success("کتاب شما با موفقیت فعال گردید."); + toast.success(window.t("کتاب شما با موفقیت فعال گردید.")); return { ...state, loading: false, error: null, updateStatus: true }; case "activation/add": - toast.success("کتاب شما با موفقیت فعال گردید."); + toast.success(window.t("کتاب شما با موفقیت فعال گردید.")); return { ...state, loading: false, error: null }; case "activation/delete": return { ...state, loading: false, error: null }; diff --git a/src/Redux/reducers/book.js b/src/Redux/reducers/book.js index 55ca41c..a901796 100644 --- a/src/Redux/reducers/book.js +++ b/src/Redux/reducers/book.js @@ -9,23 +9,23 @@ const initialState = { filterResult: [], subjects: [], levels: [], - sortFilters: ["مرتب سازی", "محبوب ترین", "جدیدترین"], + sortFilters: [window.t("مرتب سازی"), window.t("محبوب ترین"), window.t("جدیدترین")], }; const grades = [ - "پیش دبستان", - "اول", - "دوم", - "سوم", - "چهارم", - "پنجم", - "ششم", - "هفتم", - "هشتم", - "نهم", - "دهم", - "یازدهم", - "دوازدهم", + window.t("پیش دبستان"), + window.t("اول"), + window.t("دوم"), + window.t("سوم"), + window.t("چهارم"), + window.t("پنجم"), + window.t("ششم"), + window.t("هفتم"), + window.t("هشتم"), + window.t("نهم"), + window.t("دهم"), + window.t("یازدهم"), + window.t("دوازدهم"), ]; export default function book(state = initialState, action) { let { type, data } = action; @@ -35,14 +35,14 @@ export default function book(state = initialState, action) { (item, index) => item.name ); if (window.innerWidth < 1000) { - itemsSubject.unshift("نام کتاب"); + itemsSubject.unshift(window.t("نام کتاب")); } let itemsLevel = (Array.isArray(data) ? data : []) .map((item) => item.gradeId * 1) .sort((a, b) => a - b) .map((e) => grades[e]); if (window.innerWidth < 1000) { - itemsLevel.unshift("پایه تحصیلی"); + itemsLevel.unshift(window.t(window.t("پایه تحصیلی"))); } return { ...state, @@ -103,7 +103,7 @@ export default function book(state = initialState, action) { ? bySubjectFilter.filter((item1) => item1.name.indexOf(search) !== -1) : bySubjectFilter; - if (sort === "گران ترین") { + if (sort === window.t("گران ترین")) { finalSort = bySearchFilter.sort((item1, item2) => { return item1.product[0].price - item2.product[0].price; }); diff --git a/src/Redux/reducers/comment.js b/src/Redux/reducers/comment.js index 0926b89..3bb47d3 100644 --- a/src/Redux/reducers/comment.js +++ b/src/Redux/reducers/comment.js @@ -14,7 +14,7 @@ export default function comment(state = initialState, action) { case "comment/update": return { ...state, loading: false, error: null }; case "comment/add": - toast.success("ثبت درخواست با موفقیت انجام شد"); + toast.success(window.t("ثبت درخواست با موفقیت انجام شد")); return { ...state, loading: false, error: null }; case "comment/delete": return { ...state, loading: false, error: null }; diff --git a/src/Redux/reducers/public.js b/src/Redux/reducers/public.js index 6db92c3..da9bda6 100644 --- a/src/Redux/reducers/public.js +++ b/src/Redux/reducers/public.js @@ -19,19 +19,19 @@ const initialState = { }; const grades = [ - "پیش دبستان", - "اول", - "دوم", - "سوم", - "چهارم", - "پنجم", - "ششم", - "هفتم", - "هشتم", - "نهم", - "دهم", - "یازدهم", - "دوازدهم", + window.t("پیش دبستان"), + window.t("اول"), + window.t("دوم"), + window.t("سوم"), + window.t("چهارم"), + window.t("پنجم"), + window.t("ششم"), + window.t("هفتم"), + window.t("هشتم"), + window.t("نهم"), + window.t("دهم"), + window.t("یازدهم"), + window.t("دوازدهم"), ]; export default function publicApi(state = initialState, action) { let { type, data } = action; @@ -43,7 +43,7 @@ export default function publicApi(state = initialState, action) { // if (window.innerWidth > 1000) { const jadidTarin = data?.filter( - (item) => item.title === "کتاب‌های دانوین" + (item) => item.title === window.t("کتاب‌های دانوین") ); itemsLevel = jadidTarin && jadidTarin[0] && jadidTarin[0].data @@ -52,7 +52,7 @@ export default function publicApi(state = initialState, action) { .sort((a, b) => a - b) .map((e) => grades[e]) : []; - itemsLevel.unshift("پایه تحصیلی"); + itemsLevel.unshift(window.t(window.t("پایه تحصیلی"))); // } return { @@ -69,7 +69,7 @@ export default function publicApi(state = initialState, action) { case "public/filter": const realList = state.newProducts.length === 0 - ? state.homeData.filter((item) => item.title === "کتاب‌های دانوین")[0] + ? state.homeData.filter((item) => item.title === window.t("کتاب‌های دانوین"))[0] .data : state.newProducts; if (state.newProducts.length === 0) { @@ -88,7 +88,7 @@ export default function publicApi(state = initialState, action) { loading: false, error: null, homeData: state.homeData.map((item) => - item.title === "کتاب‌های دانوین" + item.title === window.t("کتاب‌های دانوین") ? { ...item, data: state.newProducts } : { ...item } ), @@ -124,7 +124,7 @@ export default function publicApi(state = initialState, action) { const bySearchFilter = search ? byLevelFilter.filter((item1) => item1.name.indexOf(search) !== -1) : byLevelFilter; - // if (sort === "گران ترین") { + // if (sort === window.t("گران ترین")) { // finalSort = bySearchFilter.sort((item1, item2) => { // return item1.product[0].price - item2.product[0].price; // }); @@ -137,7 +137,7 @@ export default function publicApi(state = initialState, action) { loading: false, error: null, homeData: state.homeData.map((item) => - item.title === "کتاب‌های دانوین" + item.title === window.t("کتاب‌های دانوین") ? { ...item, data: bySearchFilter } : { ...item } ), diff --git a/src/Redux/reducers/transport.js b/src/Redux/reducers/transport.js index 5d80f66..7cf48c6 100644 --- a/src/Redux/reducers/transport.js +++ b/src/Redux/reducers/transport.js @@ -17,7 +17,7 @@ export default function transport(state = initialState, action) { case "transport/add": return { ...state, loading: false, error: null }; case "transport/setTransport": - toast.success("روش ارسال با موفقیت تغییر یافت!"); + toast.success(window.t("روش ارسال با موفقیت تغییر یافت!")); return { ...state, loading: false, error: null }; case "transport/delete": return { ...state, loading: false, error: null }; diff --git a/src/Redux/reducers/user.js b/src/Redux/reducers/user.js index f4d0d53..bbdd7e2 100644 --- a/src/Redux/reducers/user.js +++ b/src/Redux/reducers/user.js @@ -17,11 +17,11 @@ export default function user(state = initialState, action) { case "user/register": case "user/switchRole": case "public/sendOTP": - toast.success("کد به شماره شما ارسال گردید."); + toast.success(window.t("کد به شماره شما ارسال گردید.")); return { ...state, loading: false, status: data.profile, error: null }; case "user/otp/login": // window.location = "https://dnvn.ir/?" + Math.random(); - toast.success("به دانوین خوش آمدید."); + toast.success(window.t("به دانوین خوش آمدید.")); return { ...state, diff --git a/src/Redux/reducers/userFactor.js b/src/Redux/reducers/userFactor.js index 19d67e5..0c73b37 100644 --- a/src/Redux/reducers/userFactor.js +++ b/src/Redux/reducers/userFactor.js @@ -17,10 +17,10 @@ export default function userFactor(state = initialState, action) { case "userFactor/info": return { ...state, loading: false, info: data, error: null }; case "userFactor/update": - toast.success("درخواست شما با موفقیت انجام شد."); + toast.success(window.t("درخواست شما با موفقیت انجام شد.")); return { ...state, loading: false, error: null }; case "userFactor/add": - toast.success("درخواست شما با موفقیت انجام شد."); + toast.success(window.t("درخواست شما با موفقیت انجام شد.")); return { ...state, loading: false, error: null, sum: data.payPrice }; case "userFactor/deleteUserOffCode": return { ...state, loading: false, error: null }; diff --git a/src/Redux/reducers/userProduct.js b/src/Redux/reducers/userProduct.js index 0a6b577..5ca8fbb 100644 --- a/src/Redux/reducers/userProduct.js +++ b/src/Redux/reducers/userProduct.js @@ -37,7 +37,7 @@ export default function userProduct(state = initialState, action) { return { ...state, loading: false, error: null }; case "userProduct/add": if (window.location.pathname.indexOf("products") !== -1) { - toast.success("درخواست شما با موفقیت انجام شد."); + toast.success(window.t("درخواست شما با موفقیت انجام شد.")); } return { ...state, loading: false, error: null, sum: data.payPrice }; case "userProduct/delete": diff --git a/src/views/AR/Item/index.js b/src/views/AR/Item/index.js index d3040cf..ce7f14e 100644 --- a/src/views/AR/Item/index.js +++ b/src/views/AR/Item/index.js @@ -1,19 +1,19 @@ import React, { Component } from "react"; const grades = [ - "پیش دبستان", - "اول", - "دوم", - "سوم", - "چهارم", - "پنجم", - "ششم", - "هفتم", - "هشتم", - "نهم", - "دهم", - "یازدهم", - "دوازدهم", + window.t("پیش دبستان"), + window.t("اول"), + window.t("دوم"), + window.t("سوم"), + window.t("چهارم"), + window.t("پنجم"), + window.t("ششم"), + window.t("هفتم"), + window.t("هشتم"), + window.t("نهم"), + window.t("دهم"), + window.t("یازدهم"), + window.t("دوازدهم"), ]; export default class Item extends Component { render() { diff --git a/src/views/About/index.js b/src/views/About/index.js index 0c93984..659e22c 100644 --- a/src/views/About/index.js +++ b/src/views/About/index.js @@ -28,7 +28,7 @@ const fontSize = { export default class About extends Component { state = { first: { - title: "درباره ما", + title: window.t("درباره ما"), text: "ما در دانوین با هدف ایجاد زیرساخت تعاملی و آموزشی با تولید محتوایی جذاب بصورت کتاب با کمک پلتفرم دانوین، قصد تغییراتی بنیادین در نظام آموزش و پرورش کشور داریم. دانوین پلتفرمی شامل کتاب، محتوای الکترونیکی، رویه های آموزشی، پشتیبانی علمی و نرم افزار ارائه خدمات با رویکرد مخاطب محور است.", }, fury: { @@ -37,29 +37,29 @@ export default class About extends Component { }, keywords: { - title: "کیفیت آموزش را بالا میبریم", + title: window.t("کیفیت آموزش را بالا میبریم"), list: [ - "شایستگی در ایجاد فهم علمی در موضوع هدف و در موضوعات وابسته به آن", - "شایستگی در ایجاد زمینه ی معرفتی- ارزشی موثر برای محتواهای آموزشی", + window.t("شایستگی در ایجاد فهم علمی در موضوع هدف و در موضوعات وابسته به آن"), + window.t("شایستگی در ایجاد زمینه ی معرفتی- ارزشی موثر برای محتواهای آموزشی"), ], }, keywords2: { - title: "جذابیت کلید بهبود یادگیری", + title: window.t("جذابیت کلید بهبود یادگیری"), list: [ - "بکارگیری عوامل متنوع سازگار با ارزشها برای علاقمندی دانش آموز و معلم به استفاده از محتوای دانوین", - "سازگار با نظام آ.پ : بطوریکه بتواند در مدارس فعلی مورد استفاده قرار گرفته و با نظام رسمی فعلی در تضاد نباشد", - "در راستای نیل به سند تحول : تلاش برای نزدیکی گام به گام به آرمانها و اهداف سند تحول", + window.t("بکارگیری عوامل متنوع سازگار با ارزشها برای علاقمندی دانش آموز و معلم به استفاده از محتوای دانوین"), + window.t("سازگار با نظام آ.پ : بطوریکه بتواند در مدارس فعلی مورد استفاده قرار گرفته و با نظام رسمی فعلی در تضاد نباشد"), + window.t("در راستای نیل به سند تحول : تلاش برای نزدیکی گام به گام به آرمانها و اهداف سند تحول"), ], }, advantages: { title: " مزیت رقابتی دانوین", list: [ - "بکارگیری بروز ترین تکنولوژی های تولید و مدیریت محتوای آموزشی-تربیتی (مانند واقعیت افزوده)", - "دارای رویکرد آموزش سرگرم کننده ", - "بستر تعاملی و اشتراک گذاری فیلم و محتوای آموزشی", - "رویکرد معرفتی-ارزشی", - "ویدئو های منحصر بفرد", - "متن گفتگو محور ، روایی ، قابل فهم ،جذاب و سرگرم کننده", + window.t("بکارگیری بروز ترین تکنولوژی های تولید و مدیریت محتوای آموزشی-تربیتی (مانند واقعیت افزوده)"), + window.t("دارای رویکرد آموزش سرگرم کننده "), + window.t("بستر تعاملی و اشتراک گذاری فیلم و محتوای آموزشی"), + window.t("رویکرد معرفتی-ارزشی"), + window.t("ویدئو های منحصر بفرد"), + window.t("متن گفتگو محور ، روایی ، قابل فهم ،جذاب و سرگرم کننده"), ], }, }; diff --git a/src/views/Auth/Login/Cellphone/index.js b/src/views/Auth/Login/Cellphone/index.js index e3ed02f..d0cf3e4 100644 --- a/src/views/Auth/Login/Cellphone/index.js +++ b/src/views/Auth/Login/Cellphone/index.js @@ -48,7 +48,7 @@ export default class Cellphone extends Component { } > 09 - پرچم + window.t("پرچم") عکس @@ -119,7 +119,7 @@ export default class Cellphone extends Component { } > 09 - پرچم + window.t("پرچم") {/* عکس */} diff --git a/src/views/Auth/Profile/Birthdate/index.js b/src/views/Auth/Profile/Birthdate/index.js index 5d1720f..5c0731c 100644 --- a/src/views/Auth/Profile/Birthdate/index.js +++ b/src/views/Auth/Profile/Birthdate/index.js @@ -31,7 +31,7 @@ export default function Birthdate(props) { {parent.state[name].name || - "گواهی تدریس ثبت شده و درحال بررسی می باشد"} + window.t("گواهی تدریس ثبت شده و درحال بررسی می باشد")} )} @@ -100,7 +100,7 @@ export default function Document(props) { }} > {parent.state[name].name || - "گواهی تدریس ثبت شده و درحال بررسی می باشد"} + window.t("گواهی تدریس ثبت شده و درحال بررسی می باشد")} )} diff --git a/src/views/Auth/Profile/Upload/index.js b/src/views/Auth/Profile/Upload/index.js index 56ef465..caed141 100644 --- a/src/views/Auth/Profile/Upload/index.js +++ b/src/views/Auth/Profile/Upload/index.js @@ -53,7 +53,7 @@ export default function Upload(props) { ? URL.createObjectURL(parent.state.file) : window.baseURL + "file/" + parent.state.file } - alt={"کاربر"} + alt={window.t("کاربر")} /> )} ; const grades = [ - "پیش دبستان", - "اول", - "دوم", - "سوم", - "چهارم", - "پنجم", - "ششم", - "هفتم", - "هشتم", - "نهم", - "دهم", - "یازدهم", - "دوازدهم", + window.t("پیش دبستان"), + window.t("اول"), + window.t("دوم"), + window.t("سوم"), + window.t("چهارم"), + window.t("پنجم"), + window.t("ششم"), + window.t("هفتم"), + window.t("هشتم"), + window.t("نهم"), + window.t("دهم"), + window.t("یازدهم"), + window.t("دوازدهم"), ]; const { profile } = this.props; return ( @@ -199,7 +199,7 @@ class Profile extends Component {
@@ -273,7 +273,7 @@ class Profile extends Component { parent={this} options={grades} name="gradeIds" - label={"پایه تحصیلی"} + label={window.t(window.t("پایه تحصیلی"))} selectedOptions={this.state.gradeIds} /> @@ -284,27 +284,27 @@ class Profile extends Component { parent={this} options={grades} name="gradeIds" - label={"پایه تحصیلی"} + label={window.t(window.t("پایه تحصیلی"))} selectedOptions={this.state.gradeIds} /> ) : null} - {this.state.status === "دانش آموز" && + {this.state.status === window.t("دانش آموز") && this.state.gradeIds > 9 ? (
@@ -351,7 +351,7 @@ class Profile extends Component { @@ -364,7 +364,7 @@ class Profile extends Component {