added some translate

master
A1Gard 1 month ago
parent 458ad20e35
commit 6389e88ccf

@ -1062,3 +1062,8 @@ function defTrannsport()
return \App\Models\Transport::where('is_default',1)->first()->id; return \App\Models\Transport::where('is_default',1)->first()->id;
} }
function vueTranslate($array){
return json_encode($array);
}

@ -5,26 +5,27 @@
<div class="circle" @click="changeIndex(0)"> <div class="circle" @click="changeIndex(0)">
<i class="ri-vip-diamond-line"></i> <i class="ri-vip-diamond-line"></i>
</div> </div>
Shopping card {{ translate['shopping-card'] }}
</li> </li>
<li :class="index > 0 ?'active':''"> <li :class="index > 0 ?'active':''">
<div class="circle" @click="changeIndex(1)"> <div class="circle" @click="changeIndex(1)">
<i class="ri-truck-line"></i> <i class="ri-truck-line"></i>
</div> </div>
Transport
{{ translate['transport'] }}
</li> </li>
<li :class="index > 1 ?'active':''"> <li :class="index > 1 ?'active':''">
<div class="circle" @click="changeIndex(2)"> <div class="circle" @click="changeIndex(2)">
<i class="ri-bank-card-2-line"></i> <i class="ri-bank-card-2-line"></i>
</div> </div>
Payment & discount {{ translate['discount-pay'] }}
</li> </li>
</ul> </ul>
<div class="row"> <div class="row">
<div class="col-lg-3"> <div class="col-lg-3">
<aside> <aside>
<h6 class="text-center"> <h6 class="text-center">
Totol price: {{ translate['total-price'] }}:
</h6> </h6>
<h2 class="text-center" v-if="index == 0"> <h2 class="text-center" v-if="index == 0">
{{ priceing(total) }} {{ priceing(total) }}
@ -51,19 +52,19 @@
# #
</th> </th>
<th> <th>
Image {{ translate['image'] }}
</th> </th>
<th> <th>
Name {{ translate['name'] }}
</th> </th>
<th class="text-center" style="width: 400px"> <th class="text-center" style="width: 400px">
Quantity {{ translate['quantity'] }}
</th> </th>
<th> <th>
Price {{ translate['price'] }}
</th> </th>
<th> <th>
Count {{ translate['count'] }}
</th> </th>
<th> <th>
- -
@ -119,7 +120,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="4"> <th colspan="4">
Total {{ translate['total-price'] }}
</th> </th>
<th colspan="4"> <th colspan="4">
{{ priceing(total) }} {{ priceing(total) }}
@ -132,7 +133,7 @@
<div :class="'tab' + (index == 1?'':' hide')"> <div :class="'tab' + (index == 1?'':' hide')">
<div> <div>
<h5> <h5>
Sent to: {{ translate['sent-to'] }}:
</h5> </h5>
<div v-for="(adr,j) in addresses" class="addr"> <div v-for="(adr,j) in addresses" class="addr">
<div class="form-check"> <div class="form-check">
@ -145,7 +146,7 @@
</div> </div>
<div v-if="transports.length > 0"> <div v-if="transports.length > 0">
<h5 class="mt-3"> <h5 class="mt-3">
Transport: {{ translate['transport'] }}::
</h5> </h5>
<div v-for="(trs,j) in transports" class="addr"> <div v-for="(trs,j) in transports" class="addr">
<span class="float-end p-2 badge bg-primary m-2"> <span class="float-end p-2 badge bg-primary m-2">
@ -172,13 +173,14 @@
<!-- WIP translate & discount check --> <!-- WIP translate & discount check -->
<h5 class="mt-1"> <h5 class="mt-1">
Check discount {{ translate['check-dis'] }}:
</h5> </h5>
<div class="input-group mb-3"> <div class="input-group mb-3">
<span class="input-group-text"><i class="ri-percent-line"></i></span> <span class="input-group-text"><i class="ri-percent-line"></i></span>
<input type="text" class="form-control text-center" placeholder="Discount code" :readonly="discount != null" v-model="code"> <input type="text" class="form-control text-center" placeholder="Discount code"
:readonly="discount != null" v-model="code">
<button type="button" class="input-group-text btn btn-primary" @click="discountCheck"> <button type="button" class="input-group-text btn btn-primary" @click="discountCheck">
Check {{ translate['check'] }}
</button> </button>
</div> </div>
<div v-if="discount_id != null"> <div v-if="discount_id != null">
@ -189,16 +191,16 @@
</div> </div>
<h4> <h4>
Extra description {{ translate['extra-desc'] }}
</h4> </h4>
<textarea rows="4" class="form-control" name="desc" placeholder="Your message for this order..."></textarea> <textarea rows="4" class="form-control" name="desc" :placeholder="translate['your-msg']"></textarea>
<hr> <hr>
<button v-if="canPay" class="btn btn-outline-primary w-100 btn-lg"> <button v-if="canPay" class="btn btn-outline-primary w-100 btn-lg">
<i class="ri-bank-card-2-line"></i> <i class="ri-bank-card-2-line"></i>
Pay now {{ translate['pay-now'] }}
</button> </button>
<div v-else class="alert alert-danger"> <div v-else class="alert alert-danger">
Please, Login or complete information to pay {{ translate['plz'] }}
</div> </div>
</div> </div>
</div> </div>
@ -279,6 +281,9 @@ export default {
}, },
defTransport: { defTransport: {
default: null, default: null,
},
translate: {
default: {},
} }
}, },
mounted() { mounted() {
@ -353,10 +358,10 @@ export default {
} }
if (this.discount != null){ if (this.discount != null) {
if (this.discount.type == 'PERCENT'){ if (this.discount.type == 'PERCENT') {
sum = (( 100 - this.discount.amount ) * sum ) / 100; sum = ((100 - this.discount.amount) * sum) / 100;
}else{ } else {
sum -= this.discount.amount; sum -= this.discount.amount;
} }
} }

@ -41,8 +41,7 @@
<a <a
class="btn btn-outline-primary btn-lg" @click="add2card"> class="btn btn-outline-primary btn-lg" @click="add2card">
<i class="ri-shopping-bag-3-line"></i> <i class="ri-shopping-bag-3-line"></i>
Add to card {{ translate['add-to-card'] }}
<!-- WIP translate-->
</a> </a>
</div> </div>
</template> </template>
@ -91,6 +90,9 @@ export default {
discount: { discount: {
default: null, default: null,
}, },
translate: {
default: {},
}
}, },
mounted() { mounted() {
@ -100,8 +102,8 @@ export default {
select(i) { select(i) {
document.querySelector('#price').innerText = commafy(this.qz[i].price.toString()) + ' ' + this.currency; document.querySelector('#price').innerText = commafy(this.qz[i].price.toString()) + ' ' + this.currency;
let index = this.qz[i].image; let index = this.qz[i].image;
document.querySelector('#preview a').setAttribute('href',document.querySelector(`#hidden-images a:nth-child(${index+1})`).getAttribute('href')); document.querySelector('#preview a').setAttribute('href', document.querySelector(`#hidden-images a:nth-child(${index + 1})`).getAttribute('href'));
document.querySelector('#preview img').setAttribute('src',document.querySelector(`#hidden-images a:nth-child(${index+1}) img`).getAttribute('src')); document.querySelector('#preview img').setAttribute('src', document.querySelector(`#hidden-images a:nth-child(${index + 1}) img`).getAttribute('src'));
this.selected = i; this.selected = i;
}, },
async add2card() { async add2card() {

@ -23,13 +23,13 @@
<div id="address-modal" v-if="modal" @click.self="modal = false"> <div id="address-modal" v-if="modal" @click.self="modal = false">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
Address editor <!-- WIP Translate --> {{ translate['addr-editor'] }}
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label for="st"> <label for="st">
State: <!-- WIP Translate --> {{ translate['state'] }} :
</label> </label>
<select @change="updateState" class="form-control" v-model="state_id" id="st"> <select @change="updateState" class="form-control" v-model="state_id" id="st">
<option :data-lat="s.lat" :data-lng="s.lng" :value="s.id" v-for="s in states"> <option :data-lat="s.lat" :data-lng="s.lng" :value="s.id" v-for="s in states">
@ -39,7 +39,7 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label for="st"> <label for="st">
City: <!-- WIP Translate --> {{ translate['city'] }}:
</label> </label>
<select @change="updateCity" class="form-control" v-model="city_id" id="st"> <select @change="updateCity" class="form-control" v-model="city_id" id="st">
<option :value="c.id" v-for="c in cities"> {{ c.name }}</option> <option :value="c.id" v-for="c in cities"> {{ c.name }}</option>
@ -49,12 +49,12 @@
<div ref="mapContainer" :style="'height: 300px;'+mapStyle"></div> <div ref="mapContainer" :style="'height: 300px;'+mapStyle"></div>
</div> </div>
<div class="col-12"> <div class="col-12">
<textarea rows="2" class="form-control" placeholder="Address" v-model="address"></textarea> <textarea rows="2" class="form-control" :placeholder="translate['address']"
<!-- WIP Translate --> v-model="address"></textarea>
</div> </div>
<div class="col-12"> <div class="col-12">
<label for="zip"> <label for="zip">
Postcode: <!-- WIP Translate --> {{ translate['post-code'] }}:
</label> </label>
<input type="text" class="form-control" v-model="zip"> <input type="text" class="form-control" v-model="zip">
</div> </div>
@ -128,6 +128,9 @@ export default {
darkMode: { darkMode: {
type: Boolean, type: Boolean,
default: false, default: false,
},
translate: {
default: {},
} }
}, },
async mounted() { async mounted() {
@ -238,7 +241,7 @@ export default {
$toast.success(r.data.message); $toast.success(r.data.message);
this.updateList(); this.updateList();
} }
} catch(e) { } catch (e) {
$toast.error('err!' + e.message); $toast.error('err!' + e.message);
} }
}, },
@ -257,7 +260,7 @@ export default {
this.zoom = 16; this.zoom = 16;
setTimeout(() => { setTimeout(() => {
this.changeMapCenter(this.lat, this.lng); this.changeMapCenter(this.lat, this.lng);
this.marker = L.marker({lat:this.lat, lng: this.lng}).addTo(this.map); this.marker = L.marker({lat: this.lat, lng: this.lng}).addTo(this.map);
}, 100); }, 100);
} }

@ -97,8 +97,10 @@
"Category slug": "نامک دسته", "Category slug": "نامک دسته",
"Change items sort": "", "Change items sort": "",
"Change latitude and longitude": "تغییر طول و عرض جغرافیایی", "Change latitude and longitude": "تغییر طول و عرض جغرافیایی",
"Check": "بررسی",
"Check all": "انتخاب همه", "Check all": "انتخاب همه",
"Check authenticate code": "بررسی کد احراز هویت", "Check authenticate code": "بررسی کد احراز هویت",
"Check discount": "بررسی تخفیف",
"Cities list": "فهرست شهرها", "Cities list": "فهرست شهرها",
"City": "شهر", "City": "شهر",
"Click here to upload or drag and drop here": "برای بارگزاری اینجا کلیک کنید یا موارد را کشیده و اینجا رها کنید", "Click here to upload or drag and drop here": "برای بارگزاری اینجا کلیک کنید یا موارد را کشیده و اینجا رها کنید",
@ -118,6 +120,7 @@
"Contacts list": "فهرست تماس‌ها", "Contacts list": "فهرست تماس‌ها",
"Contents": "محتوا", "Contents": "محتوا",
"Continue": "ادامه", "Continue": "ادامه",
"Count": "تعداد",
"Country": "کشور", "Country": "کشور",
"Cover": "کاور", "Cover": "کاور",
"Credit": "اعتبار", "Credit": "اعتبار",
@ -180,6 +183,7 @@
"Expire": "انقضا", "Expire": "انقضا",
"Expire date": "تاریخ انقضا", "Expire date": "تاریخ انقضا",
"Expire date": "تاریخ انقضا", "Expire date": "تاریخ انقضا",
"Extra description": "توضیحات اضافه",
"False": "خیر", "False": "خیر",
"Feature image": "تصویر شاخص", "Feature image": "تصویر شاخص",
"File": "پرونده", "File": "پرونده",
@ -265,15 +269,17 @@
"Orders count": "تعداد سفارش", "Orders count": "تعداد سفارش",
"Password": "گذرواژه", "Password": "گذرواژه",
"Pay now": "همینک پرداخت کنید", "Pay now": "همینک پرداخت کنید",
"Payment & discount": "تخفیف و پرداخت",
"Pending": "معلق", "Pending": "معلق",
"Pending tickets": "تیکت‌های بی‌پاسخ", "Pending tickets": "تیکت‌های بی‌پاسخ",
"Pin": "سنجاق", "Pin": "سنجاق",
"Please confirm your password before continuing.": "لطفا پیش از ادامه گذرواژه خود را تایید کنید", "Please confirm your password before continuing.": "لطفا پیش از ادامه گذرواژه خود را تایید کنید",
"Please upload file": "لطفا یک پرونده بارگزاری کنید", "Please upload file": "لطفا یک پرونده بارگزاری کنید",
"Please, Login or complete information to pay": "لطفا وارد شوید یا اطلاعات خود را تکمیل کنید تا اجازه پرداخت داشته باشید",
"Post": "نوشته", "Post": "نوشته",
"Post Text": "متن نوشته", "Post Text": "متن نوشته",
"Post reply": "پاسخ نوشته", "Post reply": "پاسخ نوشته",
"Post your comment": "", "Post your comment": "دیدگاه خود را ارسال کنید",
"Posts": "نوشته‌ها", "Posts": "نوشته‌ها",
"Posts list": "فهرست نوشته‌ها", "Posts list": "فهرست نوشته‌ها",
"Preview": "پیش‌نمایش", "Preview": "پیش‌نمایش",
@ -292,6 +298,7 @@
"Publish": "منتشر", "Publish": "منتشر",
"Published": "منتشرشده", "Published": "منتشرشده",
"Purchase price": "قیمت خرید", "Purchase price": "قیمت خرید",
"Quantity": "موجودی",
"Question": "سوالات", "Question": "سوالات",
"Question for:": "سوال برای:", "Question for:": "سوال برای:",
"Question\/Message": "سوال|پیام", "Question\/Message": "سوال|پیام",
@ -328,6 +335,7 @@
"Send Answer and close": "ارسال پاسخ و بستن", "Send Answer and close": "ارسال پاسخ و بستن",
"Send Password Reset Link": "ارسال پیوند بازنشانی گذرواژه", "Send Password Reset Link": "ارسال پیوند بازنشانی گذرواژه",
"Send authenticate code": "ارسال کد احراز هویت", "Send authenticate code": "ارسال کد احراز هویت",
"Sent to": "ارسال به",
"Set": "تغییر به", "Set": "تغییر به",
"Setting": "تنظیمات", "Setting": "تنظیمات",
"Setting added to website": "تنظیم به سایت اضافه شد", "Setting added to website": "تنظیم به سایت اضافه شد",
@ -374,13 +382,14 @@
"Toggle favorite": "تغییر وضعیت علاقه‌مندی", "Toggle favorite": "تغییر وضعیت علاقه‌مندی",
"Toggle navigation": "", "Toggle navigation": "",
"Toggle selection": "برعکس کردن انتخاب", "Toggle selection": "برعکس کردن انتخاب",
"Total price": "", "Total price": "مبلغ کل",
"Totol": "همه", "Totol": "همه",
"Translate": "ترجمه", "Translate": "ترجمه",
"Translate model": "ترجمه ماژول", "Translate model": "ترجمه ماژول",
"Translate updated": "ترجمه افزوده شد", "Translate updated": "ترجمه افزوده شد",
"Translate with AI": "ترجمه با هوش مصنوعی", "Translate with AI": "ترجمه با هوش مصنوعی",
"Translated by ai xstack service :TAG": "ترجمه با هوش مصنوعی xstack به :TAG ", "Translated by ai xstack service :TAG": "ترجمه با هوش مصنوعی xstack به :TAG ",
"Transport": "حمل و نقل",
"Transports": "حمل و نقل‌ها", "Transports": "حمل و نقل‌ها",
"Transports list": "فهرست حمل و نقل‌ها", "Transports list": "فهرست حمل و نقل‌ها",
"Trashed": "حذف شده‌ها", "Trashed": "حذف شده‌ها",
@ -425,6 +434,7 @@
"Your Email sent": "ایمیل شما ارسال شد", "Your Email sent": "ایمیل شما ارسال شد",
"Your comment has been submitted": "دیدگاه شما ارسال شد", "Your comment has been submitted": "دیدگاه شما ارسال شد",
"Your information is insufficient, Please complete your information": "اطلاعات شما ناقص است، لطفا اطلاعات خود را تکمیل کنید", "Your information is insufficient, Please complete your information": "اطلاعات شما ناقص است، لطفا اطلاعات خود را تکمیل کنید",
"Your message for this order...": "پیام شما ویژه این سفارش ...",
"a minute ago": "یک دقیقه پیش", "a minute ago": "یک دقیقه پیش",
"address updated": "نشانی به روز شد", "address updated": "نشانی به روز شد",
"an hour ago": "یک ساعت پیش", "an hour ago": "یک ساعت پیش",

@ -37,6 +37,13 @@
state-link="{{route('v1.state.index')}}" state-link="{{route('v1.state.index')}}"
cities-link="{{route('v1.state.show','')}}" cities-link="{{route('v1.state.show','')}}"
:dark-mode="true" :dark-mode="true"
:translate='{{vueTranslate([
'addr-editor' => __('Address editor'),
'state' => __('State'),
'city' => __('City'),
'address' => __('Address'),
'post-code' => __('Post code'),
])}}'
></address-input> ></address-input>
</div> </div>
@endif @endif

@ -23,6 +23,24 @@
:transports='@json(transports())' :transports='@json(transports())'
:def-transport="{{defTrannsport()}}" :def-transport="{{defTrannsport()}}"
:can-pay="{{!auth('customer')->check() || auth('customer')->user()->mobile == null || auth('customer')->user()->mobile == '' || auth('customer')->user()->addresses()->count() == 0?'false':'true'}}" :can-pay="{{!auth('customer')->check() || auth('customer')->user()->mobile == null || auth('customer')->user()->mobile == '' || auth('customer')->user()->addresses()->count() == 0?'false':'true'}}"
:translate='{{vueTranslate([
'shopping-card' => __('Shopping card'),
'transport' => __('Transport'),
'discount-pay' => __('Payment & discount'),
'total-price' => __('Total price'),
'image' => __('Image'),
'name' => __('Name'),
'quantity' => __('Quantity'),
'price' => __('Price'),
'count' => __('Count'),
'sent-to' => __('Sent to'),
'check-dis' => __('Check discount'),
'check' => __('Check'),
'extra-desc' => __('Extra description'),
'your-msg' => __('Your message for this order...'),
'pay-now' => __('Pay now'),
'plz' => __('Please, Login or complete information to pay'),
])}}'
> >
<br> <br>
@if(!auth('customer')->check()) @if(!auth('customer')->check())

@ -77,7 +77,7 @@
:props='@json(usableProp($product->category->props))' :props='@json(usableProp($product->category->props))'
currency="{{config('app.currency.symbol')}}" currency="{{config('app.currency.symbol')}}"
card-link="{{ route('client.product-card-toggle',$product->slug) }}" card-link="{{ route('client.product-card-toggle',$product->slug) }}"
:translate='@json(['add-to-card' => __('Add to card')])'
@if($product->hasDiscount()) @if($product->hasDiscount())
:discount='@json($product->activeDiscounts()->first())' :discount='@json($product->activeDiscounts()->first())'
@endif @endif

@ -116,7 +116,7 @@
:props='@json(usableProp($product->category->props))' :props='@json(usableProp($product->category->props))'
currency="{{config('app.currency.symbol')}}" currency="{{config('app.currency.symbol')}}"
card-link="{{ route('client.product-card-toggle',$product->slug) }}" card-link="{{ route('client.product-card-toggle',$product->slug) }}"
:translate='@json(['add-to-card' => __('Add to card')])'
@if($product->hasDiscount()) @if($product->hasDiscount())
:discount='@json($product->activeDiscounts()->first())' :discount='@json($product->activeDiscounts()->first())'
@endif @endif

@ -1,11 +1,10 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="{{config('app.locale')}}" @if(langIsRTL(config('app.locale'))) dir="rtl" @else dir="ltr" @endif >
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" <meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> <title>
@yield('title') @yield('title')
</title> </title>

Loading…
Cancel
Save