Merge branch 'language-localisation' of https://github.com/Ninjas-Code-official/Enatega-White-Label-Food-Delivery-Solution into language-localisation

This commit is contained in:
Romana-Aijaz 2024-01-04 15:02:52 +05:00
commit b6fad0b435
13 changed files with 222 additions and 53 deletions

View File

@ -111,5 +111,39 @@ export const de = {
languageText: 'Bitte wählen Sie Ihre gewünschte Sprache',
countryCodePickerTranslation: 'deu',
countryCodeSelect: 'Ländercode auswählen',
paymentNotSupported: 'Diese Zahlungsmethode unterstützt diese Währung nicht'
paymentNotSupported: 'Diese Zahlungsmethode unterstützt diese Währung nicht',
Orders: 'Bestellingen',
deliveryTime: 'Leveringstijd',
myOrders: 'Mijn bestellingen',
newOrders: 'Nieuwe bestellingen',
titleChat: 'Chat',
NoNewOrder: 'Geen nieuwe bestelling',
Somethingisworng: 'Er is iets mis',
PENDING: 'IN AFWACHTING',
ACCEPTED: 'GEACCEPTEERD',
PICKED: 'OPGEHAALD',
DELIVERED: 'GELEVERD',
COMPLETED: 'VOLTOOID',
YourOrderID: 'Uw bestelnummer',
ProductPage: 'Productpagina',
Docs: 'Documenten',
Blog: 'Blog',
AboutUs: 'Over ons',
Done: 'Klaar',
Cancel: 'Annuleren',
Usernameisrequired: 'Gebruikersnaam is verplicht',
Passwordisrequired: 'Wachtwoord is verplicht',
Loggedin: 'Ingelogd',
EnteryourEmailandPassword: 'Voer uw e-mail en wachtwoord in',
EmailorPhone: 'E-mail of telefoon',
Password: 'Wachtwoord',
NoOrdersAssignedyet: 'Nog geen bestellingen toegewezen',
Loadingorders: 'Bestellingen laden',
Orderassginedtootherrider: 'Bestelling toegewezen aan andere bezorger',
CustomerDetails: 'Klantgegevens',
Contact: 'Contact',
DelvieryLocation: 'Leveringslocatie',
OrderDetails: 'Bestelgegevens',
Subtotal: 'Subtotaal',
Assigntome: 'Toewijzen aan mij',
}

View File

@ -115,5 +115,34 @@ export const en = {
deliveryTime: 'Delivery Time',
myOrders: 'My Orders',
newOrders: 'New Orders',
titleChat: 'Chat'
titleChat: 'Chat',
NoNewOrder: 'No New Order',
Somethingisworng: 'Something is worng',
PENDING: 'PENDING',
ACCEPTED: 'ACCEPTED',
PICKED: 'PICKED',
DELIVERED: 'DELIVERED',
COMPLETED: 'COMPLETED',
YourOrderID: 'Your Order ID',
ProductPage: 'Product Page',
Docs: 'Docs',
Blog: 'Blog',
AboutUs: 'About Us',
Done: 'Done',
Cancel: 'Cancel',
Usernameisrequired: 'Username is required',
Passwordisrequired: 'Password is required',
Loggedin: 'Logged in',
EnteryourEmailandPassword: 'Enter your Email and Password',
EmailorPhone: 'Email or Phone',
Password: 'Password',
NoOrdersAssignedyet: 'No Orders Assigned yet',
Loadingorders: 'Loading orders',
Orderassginedtootherrider: 'Order assgined to other rider',
CustomerDetails: 'Customer Details',
Contact: 'Contact',
DelvieryLocation: 'Delviery Location',
OrderDetails: 'Order Details',
Subtotal: 'Subtotal',
Assigntome: 'Assign to me',
}

View File

@ -111,5 +111,40 @@ export const fr = {
languageText: "S'il vous plaît sélectionnez votre langue requise",
countryCodePickerTranslation: 'fra',
countryCodeSelect: 'Sélectionnez le code pays',
paymentNotSupported: 'Ce mode de paiement ne prend pas en charge cette devise'
paymentNotSupported: 'Ce mode de paiement ne prend pas en charge cette devise',
Orders: 'Commandes',
deliveryTime: 'Délai de livraison',
myOrders: 'Mes commandes',
newOrders: 'Nouvelles commandes',
titleChat: 'Chat',
NoNewOrder: 'Pas de nouvelle commande',
Somethingisworng: 'Quelque chose ne va pas',
PENDING: 'EN ATTENTE',
ACCEPTED: 'ACCEPTÉE',
PICKED: 'PRÉLEVÉE',
DELIVERED: 'LIVRÉE',
COMPLETED: 'COMPLÉTÉE',
YourOrderID: 'Votre numéro de commande',
ProductPage: 'Page produit',
Docs: 'Documents',
Blog: 'Blog',
AboutUs: 'À propos de nous',
Done: 'Terminé',
Cancel: 'Annuler',
Usernameisrequired: 'Nom d\'utilisateur requis',
Passwordisrequired: 'Mot de passe requis',
Loggedin: 'Connecté',
EnteryourEmailandPassword: 'Entrez votre e-mail et votre mot de passe',
EmailorPhone: 'E-mail ou téléphone',
Password: 'Mot de passe',
NoOrdersAssignedyet: 'Aucune commande attribuée pour le moment',
Loadingorders: 'Chargement des commandes',
Orderassginedtootherrider: 'Commande attribuée à un autre livreur',
CustomerDetails: 'Détails du client',
Contact: 'Contact',
DelvieryLocation: 'Emplacement de livraison',
OrderDetails: 'Détails de la commande',
Subtotal: 'Sous-total',
Assigntome: 'Attribuer à moi',
}

View File

@ -108,8 +108,40 @@ export const km = {
languageText: 'សូមជ្រើសរើសភាសាដែលអ្នកត្រូវការ',
countryCodePickerTranslation: 'eng',
countryCodeSelect: 'ជ្រើសរើសលេខកូដប្រទេស',
paymentNotSupported: 'វិធីសាស្ត្រទូទាត់នេះមិនគាំទ្ររូបិយប័ណ្ណនេះទេ',
deliveryTime: 'ពេលវេលាដឹកជញ្ជូន',
paymentNotSupported: 'វិធានមិនគាំទ្រប្រចាំរូបិយប័ណ្ណនេះ',
Orders: 'ការបញ្ជាទិញ',
deliveryTime: 'ពេលដឹកជញ្ជាំង',
myOrders: 'ការបញ្ជាទិញរបស់ខ្ញុំ',
newOrders: 'ការបញ្ជាទិញថ្មី'
newOrders: 'ការបញ្ជាទិញថ្មី',
titleChat: 'ជជែក',
NoNewOrder: 'គ្មានការបញ្ជាទិញថ្មី',
Somethingisworng: 'មានអ្វីមិនប្រក្រតី',
PENDING: 'រងចាំ',
ACCEPTED: 'បានទទួលយក',
PICKED: 'បានយក',
DELIVERED: 'បានដឹកជញ្ជាំង',
COMPLETED: 'បានបញ្ចប់',
YourOrderID: 'លេខសម្គាល់ការបញ្ជាទិញរបស់អ្នក',
ProductPage: 'ទំព័រផលិតផល',
Docs: 'ឯកសារ',
Blog: 'ប្លក់',
AboutUs: 'អំពី​ពួក​យើង',
Done: 'រួចរាល់',
Cancel: 'លើកអស់',
Usernameisrequired: 'ត្រូវការឈ្មោះអ្នកប្រើ',
Passwordisrequired: 'ត្រូវការពាក្យសម្ងាត់',
Loggedin: 'បានចូលប្រើ',
EnteryourEmailandPassword: 'បញ្ចូលអ៊ីមែល និងពាក្យសម្ងាត់',
EmailorPhone: 'អ៊ីមែល ឬទូរស័ព្ទ',
Password: 'ពាក្យសម្ងាត់',
NoOrdersAssignedyet: 'មិនទាន់មានការបញ្ជាទិញដែលបានផ្ទេរទេ',
Loadingorders: 'កំពុងផ្ទុកការបញ្ជាទិញ',
Orderassginedtootherrider: 'ការបញ្ជាទិញត្រូវបានផ្ទេរទៅហាងផ្សេងៗ',
CustomerDetails: 'ព័ត៌មានអតិថិជន',
Contact: 'ទំនាក់ទំនង',
DelvieryLocation: 'ទីតាំងដឹកជញ្ជាំង',
OrderDetails: 'ព័ត៌មានការបញ្ជាទិញ',
Subtotal: 'សរុបរង',
Assigntome: 'ផ្ដល់ទៅខ្លួនឯង',
}

View File

@ -104,5 +104,40 @@ export const zh = {
languageText: '请选择您需要的语言',
countryCodePickerTranslation: 'zho',
countryCodeSelect: '选择国家代码',
paymentNotSupported: '此付款方式不支持此货币'
paymentNotSupported: '此付款方式不支持此货币',
Orders: '订单',
deliveryTime: '交货时间',
myOrders: '我的订单',
newOrders: '新订单',
titleChat: '聊天',
NoNewOrder: '没有新订单',
Somethingisworng: '出现问题',
PENDING: '待处理',
ACCEPTED: '已接受',
PICKED: '已拾取',
DELIVERED: '已交付',
COMPLETED: '已完成',
YourOrderID: '您的订单号',
ProductPage: '产品页面',
Docs: '文档',
Blog: '博客',
AboutUs: '关于我们',
Done: '完成',
Cancel: '取消',
Usernameisrequired: '需要用户名',
Passwordisrequired: '需要密码',
Loggedin: '已登录',
EnteryourEmailandPassword: '输入您的电子邮件和密码',
EmailorPhone: '电子邮件或电话',
Password: '密码',
NoOrdersAssignedyet: '尚未分配订单',
Loadingorders: '加载订单',
Orderassginedtootherrider: '订单已分配给其他骑手',
CustomerDetails: '客户详情',
Contact: '联系',
DelvieryLocation: '交货地点',
OrderDetails: '订单详情',
Subtotal: '小计',
Assigntome: '分配给我',
}

View File

@ -7,6 +7,7 @@ import UserContext from '../../context/user'
import TextError from '../Text/TextError/TextError'
import { useNavigation } from '@react-navigation/native'
import { verticalScale } from '../../utilities/scaling'
import i18n from '../../../i18n'
export default function Orders() {
const navigation = useNavigation()
@ -20,10 +21,10 @@ export default function Orders() {
} = useContext(UserContext)
if (loadingAssigned) return <Spinner />
if (errorAssigned) return <TextError text="Something is worng" />
if (errorAssigned) return <TextError text={i18n.t('Somethingisworng')} />
function emptyView() {
return <TextError text="No Orders Assigned yet!" />
return <TextError text={i18n.t('NoOrdersAssignedyet')} />
}
return (

View File

@ -7,6 +7,7 @@ import UserContext from '../../context/user'
import TextError from '../Text/TextError/TextError'
import { useNavigation } from '@react-navigation/native'
import { verticalScale } from '../../utilities/scaling'
import i18n from '../../../i18n'
export default function Orders() {
const navigation = useNavigation()
@ -20,11 +21,11 @@ export default function Orders() {
} = useContext(UserContext)
function emptyView() {
return <TextError text="No New Order" />
return <TextError text={i18n.t('NoNewOrder')} />
}
if (loadingUnAssigned) return <Spinner />
if (errorUnAssigned) return <TextError text="Something is worng" />
if (errorUnAssigned) return <TextError text={i18n.t('Somethingisworng')} />
return (
<FlatList

View File

@ -60,7 +60,7 @@ function Order(props) {
numberOfLines={2}
bold
textColor={colors.placeHolderColor}>
Your {i18n.t('orderId')}
{i18n.t('YourOrderID')}
</TextDefault>
<TextDefault H4 bolder>
{props.orderId}
@ -77,7 +77,7 @@ function Order(props) {
bold
uppercase
style={{ ...alignment.PLxSmall, ...alignment.PRxSmall }}>
{props.orderStatus}
{i18n.t(props.orderStatus)}
</TextDefault>
</View>
<View style={{ paddingLeft: '5%' }}>
@ -106,13 +106,13 @@ function Order(props) {
textColor={colors.placeHolderColor}
bold
style={{ ...alignment.MTxSmall }}>
Payment method
{i18n.t('paymentMethod')}
</TextDefault>
<TextDefault
textColor={colors.placeHolderColor}
bold
style={{ ...alignment.MTxSmall }}>
Delivery Time
{i18n.t('deliveryTime')}
</TextDefault>
</View>
<View>

View File

@ -10,17 +10,17 @@ import styles from './styles'
const links = [
{
title: 'Product Page',
title: i18n.t('ProductPage'),
url:
'https://enatega.com/enatega-single-vendor/'
},
{ title: 'Docs', url: 'https://enatega.com/docs/enatega-singlevendor-rider-app-introduction/' },
{ title: i18n.t('Docs'), url: 'https://enatega.com/docs/enatega-singlevendor-rider-app-introduction/' },
{
title: 'Blog',
title: i18n.t('Blog'),
url:
'https://enatega.com/blog/'
},
{ title: 'About Us', url: 'https://ninjascode.com/our-team/' }
{ title: i18n.t('AboutUs'), url: 'https://ninjascode.com/our-team/' }
]
function Help() {
const navigation = useNavigation()

View File

@ -113,7 +113,7 @@ function Language() {
justifyContent: 'center'
}}>
<TextDefault H5 bold textColor={colors.fontSecondColor}>
Done
{i18n.t('Done')}
</TextDefault>
</TouchableOpacity>
<TouchableOpacity
@ -127,7 +127,7 @@ function Language() {
justifyContent: 'center'
}}>
<TextDefault H5 bold textColor={colors.fontMainColor}>
Cancel
{i18n.t('Cancel')}
</TextDefault>
</TouchableOpacity>
</View>

View File

@ -55,11 +55,11 @@ export default function Login() {
setPasswordError('')
if (!username) {
setUsernameError('Username is required')
setUsernameError(i18n.t('Usernameisrequired'))
res = false
}
if (!password) {
setPasswordError('Password is required')
setPasswordError(i18n.t('Passwordisrequired'))
res = false
}
return res
@ -67,23 +67,23 @@ export default function Login() {
async function onCompleted(data) {
FlashMessage({
message: 'Logged in'
message: i18n.t('Loggedin')
})
await AsyncStorage.setItem('rider-id', data.riderLogin.userId)
setTokenAsync(data.riderLogin.token)
}
function onError({ networkError, graphQLErrors }) {
console.log('errors', networkError, graphQLErrors)
// let message = ''
// if (!!graphQLErrors && graphQLErrors.length) {
// message = graphQLErrors[0].message
// }
// if (!!networkError) {
// message = networkError.result.errors[0].message
// }
// FlashMessage({
// message: message
// })
let message = ''
if (!!graphQLErrors && graphQLErrors.length) {
message = graphQLErrors[0].message
}
if (!!networkError) {
message = networkError.result.errors[0].message
}
FlashMessage({
message: message
})
}
return (
@ -100,13 +100,13 @@ export default function Login() {
<TextDefault
style={alignment.MBmedium}
textColor={colors.placeHolderColor}>
Enter your Email and Password
{i18n.t('EnteryourEmailandPassword')}
</TextDefault>
<FilledTextField
defaultValue={'rider'}
error={usernameError}
keyboardType={'email-address'}
label={'Email or Phone'}
label={i18n.t('EmailorPhone')}
labelFontSize={scale(12)}
fontSize={scale(12)}
activeLineWidth={0}
@ -126,7 +126,7 @@ export default function Login() {
<FilledTextField
defaultValue={'123123'}
error={passwordError}
label={'Password'}
label={i18n.t('Password')}
secureTextEntry
labelFontSize={scale(12)}
fontSize={scale(12)}

View File

@ -6,6 +6,7 @@ import UserContext from '../../context/user'
import styles from './style'
import { TextError, Spinner } from '../../components'
import { useNavigation } from '@react-navigation/native'
import i18n from '../../../i18n'
export default function Orders() {
const navigation = useNavigation()
@ -19,11 +20,11 @@ export default function Orders() {
} = useContext(UserContext)
function emptyView() {
return <TextError text="No New Order" />
return <TextError text={i18n.t('NoNewOrder')} />
}
if (loadingUnAssigned) return <Spinner />
if (errorUnAssigned) return <TextError text="Something is worng" />
if (errorUnAssigned) return <TextError text={i18n.t('Somethingisworng')} />
return (
<View style={styles.flex}>

View File

@ -20,6 +20,7 @@ import colors from "../../utilities/colors";
import { linkToMapsApp } from "../../utilities/links";
import { scale } from "../../utilities/scaling";
import styles from "./styles";
import i18n from "../../../i18n";
const CONFIGURATION = gql`
${configuration}
@ -172,17 +173,17 @@ function OrderDetail() {
}
if (loadingAssigned || loadingUnAssigned) {
return <TextError text="Loading orders" />;
return <TextError text={i18n.t('Loadingorders')} />;
}
if (loadingConfig) {
return <Spinner />;
}
if (errorConfig) {
return <TextError text="Something is worng" />;
return <TextError text={i18n.t('Somethingisworng')} />;
}
if (!selectedOrder) {
return (
<TextError text="Order assgined to other rider,(something like that)" />
<TextError text={i18n.t('Orderassginedtootherrider')} />
);
}
@ -202,7 +203,7 @@ function OrderDetail() {
textColor={colors.tagColor}
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Customer Details
{i18n.t('CustomerDetails')}
</TextDefault>
</View>
<View style={styles.customerContent}>
@ -214,7 +215,7 @@ function OrderDetail() {
textColor={colors.placeHolderColor}
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Name
{i18n.t('name')}
</TextDefault>
<TextDefault bolder style={{ ...alignment.PBxSmall }}>
{selectedOrder.user.name}
@ -228,7 +229,7 @@ function OrderDetail() {
textColor={colors.placeHolderColor}
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Contact
{i18n.t('Contact')}
</TextDefault>
<TextDefault bolder style={{ ...alignment.PBxSmall }}>
{selectedOrder.user.phone}
@ -242,7 +243,7 @@ function OrderDetail() {
textColor={colors.placeHolderColor}
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Delviery Location
{i18n.t('DelvieryLocation')}
</TextDefault>
<TextDefault
numberOfLines={2}
@ -266,7 +267,7 @@ function OrderDetail() {
textColor={colors.tagColor}
style={{ ...alignment.PTmedium }}
>
Order Details
{i18n.t('OrderDetails')}
</TextDefault>
</View>
<View style={styles.orderSpacer} />
@ -284,7 +285,7 @@ function OrderDetail() {
bolder
style={{ ...alignment.PTmedium, ...alignment.PLmedium }}
>
Subtotal
{i18n.t('Subtotal')}
</TextDefault>
</View>
<View style={styles.orderTextRight}>
@ -311,7 +312,7 @@ function OrderDetail() {
bolder
style={{ ...alignment.PLmedium }}
>
Delivery Charges
{i18n.t('delvieryCharges')}
</TextDefault>
</View>
<View style={styles.orderTextRight}>
@ -331,7 +332,7 @@ function OrderDetail() {
<View style={styles.orderSubRow}>
<View style={styles.orderTextLeft}>
<TextDefault H4 bolder>
Total
{i18n.t('total')}
</TextDefault>
</View>
<View style={styles.orderTextRight}>
@ -423,7 +424,7 @@ function OrderDetail() {
bold
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Assign to me
{i18n.t('Assigntome')}
</TextDefault>
)}
</TouchableOpacity>
@ -449,7 +450,7 @@ function OrderDetail() {
bold
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Picked
{i18n.t('Picked')}
</TextDefault>
</TouchableOpacity>
)}
@ -468,7 +469,7 @@ function OrderDetail() {
bold
style={{ ...alignment.PTxSmall, ...alignment.PBxSmall }}
>
Delivered
{i18n.t('Delivered')}
</TextDefault>
</TouchableOpacity>
)}