From 8e4276002f636273816632322c2c3e17abaf497e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=BCleyman=20Ba=C5=9Fbu=C4=9F?= Date: Thu, 2 Jun 2022 12:28:42 +0300 Subject: [PATCH] i18n has been changed --- scripts/app.ts | 2 +- scripts/components/FlLogin.ts | 27 ++++++------ scripts/components/FlRateProduct.ts | 3 +- scripts/components/FlSignup.ts | 37 ++++++++-------- scripts/components/LviAccount.ts | 4 +- scripts/i18n/de.ts | 4 +- scripts/i18n/en.ts | 4 +- scripts/i18n/fi.ts | 4 +- scripts/i18n/i18n.ts | 50 ---------------------- scripts/i18n/index.ts | 26 ++++++++++++ scripts/i18n/tr.ts | 4 +- scripts/lib/checkoutDialog.ts | 15 ++++--- scripts/lib/deeplink.ts | 5 ++- scripts/lib/listView.ts | 3 +- scripts/lib/profileImageMenu.ts | 32 +++++++------- scripts/lib/setHeaderIcon.ts | 3 +- scripts/lib/toast.ts | 5 ++- scripts/package.json | 9 ++-- scripts/pages/pgAccount.ts | 24 ++++++----- scripts/pages/pgAddAddress.ts | 13 +++--- scripts/pages/pgAddReview.ts | 15 ++++--- scripts/pages/pgAddress.ts | 9 ++-- scripts/pages/pgCart.ts | 23 +++++----- scripts/pages/pgCategories.ts | 5 ++- scripts/pages/pgCategoryDetail.ts | 10 +++-- scripts/pages/pgCheckoutSuccessful.ts | 9 ++-- scripts/pages/pgFavorites.ts | 11 ++--- scripts/pages/pgHome.ts | 11 ++--- scripts/pages/pgMyDetails.ts | 5 ++- scripts/pages/pgNotifications.ts | 3 +- scripts/pages/pgNumber.ts | 7 +-- scripts/pages/pgNutritions.ts | 5 ++- scripts/pages/pgProductDescription.ts | 5 ++- scripts/pages/pgProductDetail.ts | 19 +++++---- scripts/pages/pgReviews.ts | 7 +-- scripts/pages/pgUserSettings.ts | 5 ++- scripts/pages/pgVerification.ts | 9 ++-- scripts/routes/tabbar.ts | 12 +++--- scripts/yarn.lock | 61 ++++++++++++++++++++------- 39 files changed, 273 insertions(+), 232 deletions(-) delete mode 100755 scripts/i18n/i18n.ts create mode 100644 scripts/i18n/index.ts diff --git a/scripts/app.ts b/scripts/app.ts index 7fed6336..f0634414 100755 --- a/scripts/app.ts +++ b/scripts/app.ts @@ -1,5 +1,5 @@ /* globals lang */ -import 'i18n/i18n'; // Generates global lang object +import 'i18n'; // Generates global lang object import '@smartface/native'; import 'theme'; import 'lib/deeplink'; diff --git a/scripts/components/FlLogin.ts b/scripts/components/FlLogin.ts index 08861f36..b6ed2efc 100644 --- a/scripts/components/FlLogin.ts +++ b/scripts/components/FlLogin.ts @@ -4,6 +4,7 @@ import { EMAIL_REGEXP, MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD } from 'constant import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; import { NativeStackRouter, Router } from '@smartface/router'; import { login } from 'service/auth'; +import { i18n } from '@smartface/i18n'; export default class FlLogin extends FlLoginDesign { pageName?: string | undefined; @@ -17,12 +18,12 @@ export default class FlLogin extends FlLoginDesign { this.btnLogin.on('press', () => { this.initUserLogin(); }); - this.lblTitle.text = global.lang.login; - this.lblText.text = global.lang.loginSubText; - this.btnLogin.text = global.lang.login; - this.lblForgetPassword.text = global.lang.forgotPassword; - this.lblRouteSignUp.text = global.lang.signup; - this.lblLeft.text = global.lang.donthaveanaccount; + this.lblTitle.text = `${i18n.instance.t('login')}`; + this.lblText.text = `${i18n.instance.t('loginSubText')}`; + this.btnLogin.text = `${i18n.instance.t('login')}`; + this.lblForgetPassword.text = `${i18n.instance.t('forgotPassword')}`; + this.lblRouteSignUp.text = `${i18n.instance.t('signup')}`; + this.lblLeft.text = `${i18n.instance.t('donthaveanaccount')}`; } get router(): Router { return this._router; @@ -40,10 +41,10 @@ export default class FlLogin extends FlLoginDesign { this.mtbPassword.android.enableErrorMessage = true; this.mtbEmail.options = { - hint: global.lang.email + hint: `${i18n.instance.t('email')}` }; this.mtbPassword.options = { - hint: global.lang.password + hint: `${i18n.instance.t('password')}` }; this.mtbPassword.materialTextBox.isPassword = true; } @@ -62,8 +63,8 @@ export default class FlLogin extends FlLoginDesign { } } catch (error) { alert({ - title: global.lang.warning, - message: global.lang.userNotFoundWithThisCredentials + title: `${i18n.instance.t('warning')}`, + message: `${i18n.instance.t('userNotFoundWithThisCredentials')}` }); } finally { hideWaitDialog(); @@ -82,7 +83,7 @@ export default class FlLogin extends FlLoginDesign { this.mtbEmail.materialTextBox.errorMessage = ''; } else { this.isMailValid = false; - this.mtbEmail.materialTextBox.errorMessage = global.lang.invalidEmail; + this.mtbEmail.materialTextBox.errorMessage = `${i18n.instance.t('invalidEmail')}`; } if (passwordExists && this.mtbPassword.materialTextBox.text.length >= MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD) { @@ -90,9 +91,9 @@ export default class FlLogin extends FlLoginDesign { this.mtbPassword.materialTextBox.errorMessage = ''; } else { this.isPasswordValid = false; - this.mtbPassword.materialTextBox.errorMessage = global.lang.minimumCharacterErrorOnPassword.replace( + this.mtbPassword.materialTextBox.errorMessage = `${i18n.instance.t('minimumCharacterErrorOnPassword')}`.replace( '$1', - MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD + MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD.toString() ); } if (this.isMailValid && this.isPasswordValid) { diff --git a/scripts/components/FlRateProduct.ts b/scripts/components/FlRateProduct.ts index b63e660e..312da14b 100644 --- a/scripts/components/FlRateProduct.ts +++ b/scripts/components/FlRateProduct.ts @@ -1,5 +1,6 @@ import ImageView from '@smartface/native/ui/imageview'; import FlRateProductDesign from 'generated/my-components/FlRateProduct'; +import { i18n } from '@smartface/i18n'; export default class FlRateProduct extends FlRateProductDesign { pageName?: string | undefined; @@ -8,7 +9,7 @@ export default class FlRateProduct extends FlRateProductDesign { constructor(props?: any, pageName?: string) { super(props); this.pageName = pageName; - this.lblHeader.text = global.lang.rateProduct; + this.lblHeader.text = `${i18n.instance.t('rateProduct')}`; this.images = [this.imgStar1, this.imgStar2, this.imgStar3, this.imgStar4, this.imgStar5]; this.images.forEach((imageViewStar, index) => { imageViewStar.on('touchEnded', () => { diff --git a/scripts/components/FlSignup.ts b/scripts/components/FlSignup.ts index f0c81080..9fc5d252 100644 --- a/scripts/components/FlSignup.ts +++ b/scripts/components/FlSignup.ts @@ -6,6 +6,7 @@ import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; import { register } from 'service/commerce'; import AttributedString from '@smartface/native/ui/attributedstring'; import { themeService } from 'theme'; +import { i18n } from '@smartface/i18n'; export default class FlSignup extends FlSignupDesign { pageName?: string | undefined; @@ -28,9 +29,9 @@ export default class FlSignup extends FlSignupDesign { this.mtbFirstName.materialTextBox.removeFocus(); return true; } - this.lblTitle.text = global.lang.signup; - this.lblText.text = global.lang.signupSubText; - this.btnSignUp.text = global.lang.signup; + this.lblTitle.text = `${i18n.instance.t('signup')}`; + this.lblText.text = `${i18n.instance.t('signupSubText')}`; + this.btnSignUp.text = `${i18n.instance.t('signup')}`; } get router(): Router { @@ -45,16 +46,16 @@ export default class FlSignup extends FlSignupDesign { initMaterialBoxes(){ this.mtbFirstName.options = { - hint: global.lang.firstName + hint: `${i18n.instance.t('firstName')}` }; this.mtbLastName.options = { - hint: global.lang.lastName + hint: `${i18n.instance.t('lastName')}` }; this.mtbEmail.options = { - hint: global.lang.email + hint: `${i18n.instance.t('email')}` }; this.mtbPassword.options = { - hint: global.lang.password + hint: `${i18n.instance.t('password')}` }; this.mtbPassword.materialTextBox.isPassword = true; } @@ -74,8 +75,8 @@ export default class FlSignup extends FlSignupDesign { } } catch (error) { alert({ - title: global.lang.warning, - message: global.lang.alreadyExist + title: `${i18n.instance.t('warning')}`, + message: `${i18n.instance.t('alreadyExist')}` }); } finally { hideWaitDialog(); @@ -100,8 +101,8 @@ export default class FlSignup extends FlSignupDesign { this.mtbLastName.materialTextBox.errorMessage = ''; } else { this.namesValid = false; - this.mtbFirstName.materialTextBox.errorMessage = global.lang.invalidName.replace('$1', MINIMUM_CHARACTERS_REQUIRED); - this.mtbLastName.materialTextBox.errorMessage = global.lang.invalidName.replace('$1', MINIMUM_CHARACTERS_REQUIRED); + this.mtbFirstName.materialTextBox.errorMessage = `${i18n.instance.t('invalidName')}`.replace('$1', MINIMUM_CHARACTERS_REQUIRED.toString()); + this.mtbLastName.materialTextBox.errorMessage = `${i18n.instance.t('invalidName')}`.replace('$1', MINIMUM_CHARACTERS_REQUIRED.toString()); } if (mailExist && this.checkIsEmailValid(this.mtbEmail.materialTextBox.text)) { @@ -109,7 +110,7 @@ export default class FlSignup extends FlSignupDesign { this.mtbEmail.materialTextBox.errorMessage = ''; } else { this.isMailValid = false; - this.mtbEmail.materialTextBox.errorMessage = global.lang.invalidEmail; + this.mtbEmail.materialTextBox.errorMessage = `${i18n.instance.t('invalidEmail')}`; } if (passwordExists && this.mtbPassword.materialTextBox.text.length >= MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD) { @@ -117,9 +118,9 @@ export default class FlSignup extends FlSignupDesign { this.mtbPassword.materialTextBox.errorMessage = ''; } else { this.isPasswordValid = false; - this.mtbPassword.materialTextBox.errorMessage = global.lang.minimumCharacterErrorOnPassword.replace( + this.mtbPassword.materialTextBox.errorMessage = `${i18n.instance.t('minimumCharacterErrorOnPassword')}`.replace( '$1', - MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD + MINIMUM_CHARACTERS_REQUIRED_FOR_PASSWORD.toString() ); } if (this.isMailValid && this.isPasswordValid) { @@ -135,22 +136,22 @@ export default class FlSignup extends FlSignupDesign { private initAttributedStrings() { const termsLeft = new AttributedString({ - string: global.lang.termsLeft, + string: `${i18n.instance.t('termsLeft')}`, font: themeService.getNativeStyle('.signup.termsLeft').font, foregroundColor: themeService.getNativeStyle('.signup.termsLeft').textColor }); const termsRight = new AttributedString({ - string: global.lang.termsRight, + string: `${i18n.instance.t('termsRight')}`, font: themeService.getNativeStyle('.signup.termsPrivacyRight').font, foregroundColor: themeService.getNativeStyle('.signup.termsPrivacyRight').textColor }); const privacyLeft = new AttributedString({ - string: global.lang.privacyLeft, + string: `${i18n.instance.t('privacyLeft')}`, font: themeService.getNativeStyle('.signup.privacyLeft').font, foregroundColor: themeService.getNativeStyle('.signup.privacyLeft').textColor }); const privacyRight = new AttributedString({ - string: global.lang.privacyRight, + string: `${i18n.instance.t('privacyRight')}`, font: themeService.getNativeStyle('.signup.termsPrivacyRight').font, foregroundColor: themeService.getNativeStyle('.signup.termsPrivacyRight').textColor }); diff --git a/scripts/components/LviAccount.ts b/scripts/components/LviAccount.ts index 7652adc4..633f0f40 100644 --- a/scripts/components/LviAccount.ts +++ b/scripts/components/LviAccount.ts @@ -1,5 +1,7 @@ import { themeService } from 'theme'; import LviAccountDesign from 'generated/my-components/LviAccount'; +import { i18n } from '@smartface/i18n'; + const originalHeight = themeService.getStyle('.lviAccount').height; export default class LviAccount extends LviAccountDesign { @@ -28,7 +30,7 @@ export default class LviAccount extends LviAccountDesign { return this.lblAccountLviTitle.text; } set itemTitle(value: string) { - this.lblAccountLviTitle.text = global.lang[value]; + this.lblAccountLviTitle.text = `${i18n.instance.t(`${value}`)}`; } get leftIcon(): string { return this.lblAccountLeftIcon.text; diff --git a/scripts/i18n/de.ts b/scripts/i18n/de.ts index e14546ff..47718cc3 100755 --- a/scripts/i18n/de.ts +++ b/scripts/i18n/de.ts @@ -1,4 +1,4 @@ -SMF.i18n.defineLanguage('de', { +export default { cancel: 'Stornieren', copy: 'Kopieren', done: 'Übersetzung', @@ -13,4 +13,4 @@ SMF.i18n.defineLanguage('de', { sureToDelete: 'Sind Sie sicher zu löschen?', networkError: 'Es hat einen Netzwerkfehler, bitte versuchen Sie es später noch einmal', applicationError: 'Es ist ein nicht behandelter Anwendungsfehler gewesen, informieren Sie bitte Entwickler' -}); +}; diff --git a/scripts/i18n/en.ts b/scripts/i18n/en.ts index 44c70fd7..85aa78fc 100755 --- a/scripts/i18n/en.ts +++ b/scripts/i18n/en.ts @@ -1,4 +1,4 @@ -SMF.i18n.defineLanguage('en', { +export default { verificationCode: 'Verification Code', productDetail: 'Product Detail', goToCheckout: 'Go to Checkout', @@ -166,4 +166,4 @@ SMF.i18n.defineLanguage('en', { trackOrder: 'Track Order', backHome: 'Back to home', checkoutLoginError: 'You must be logged in to go to the checkout page.' -}); +}; diff --git a/scripts/i18n/fi.ts b/scripts/i18n/fi.ts index 3be4fb72..969ca689 100755 --- a/scripts/i18n/fi.ts +++ b/scripts/i18n/fi.ts @@ -1,4 +1,4 @@ -SMF.i18n.defineLanguage('fi', { + export default { cancel: 'Keskeytä', copy: 'Kopioi', done: 'Käännös ', @@ -13,4 +13,4 @@ SMF.i18n.defineLanguage('fi', { sureToDelete: 'Haluatko varmasti poistaa?', networkError: 'Tapahtui verkkovirhe. Yritä myöhemmin uudelleen', applicationError: 'Tapahtui käsittelemätön virhe. Ilmoita sovelluksen kehittäjille' -}); +}; diff --git a/scripts/i18n/i18n.ts b/scripts/i18n/i18n.ts deleted file mode 100755 index 27009cc4..00000000 --- a/scripts/i18n/i18n.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - "lang" variable is required for things like system level error messages and alert button messages. - Current implementation tries to load the value found in the variable "Device.language". - If this value is not defined, "SMF.i18n.switchLanguage" function tries to load the value given with "SMF.i18n.defaultLang", which is originally set to be "en". - If that fails, first found key in "SMF.i18n.languageKV" is attempted to be loaded, and if nothing is found, then nothing is loaded. - "SMF.i18n.languageKV" is populated by calling "SMF.i18n.defineLanguage". - Required for BC -*/ -global.lang = {}; - -SMF.i18n = { - currentLang: null, - defaultLang: 'en', - languageKV: {}, - get: function (key, languageCode) { - languageCode = languageCode || this.currentLang; - if (typeof this.languageKV[languageCode] === 'undefined') { - return ''; - } - return this.languageKV[languageCode][key]; - }, - defineLanguage: function (languageCode, obj) { - this.languageKV[languageCode] = obj; - }, - switchLanguage: function (languageCode) { - if (typeof this.languageKV[languageCode] === 'undefined') { - if (typeof this.languageKV[this.defaultLang] === 'undefined') { - const languageCodes = Object.keys(this.languageKV); - if (languageCodes.length === 0) { - return; - } - // In case default options did not work, pick the first one. - this.switchLanguage(languageCodes[0]); - } else { - this.switchLanguage(this.defaultLang); - } - } else { - this.currentLang = languageCode; - global.lang = this.languageKV[languageCode]; - } - } -}; - -import Data from '@smartface/native/global/data'; -import 'i18n/de'; -import 'i18n/en'; -import 'i18n/fi'; -import 'i18n/tr'; -//Data.getStringVariable('language') ? Data.getStringVariable('language') : -SMF.i18n.switchLanguage(Data.getStringVariable('language') ? Data.getStringVariable('language') : Device.language); diff --git a/scripts/i18n/index.ts b/scripts/i18n/index.ts new file mode 100644 index 00000000..a780728b --- /dev/null +++ b/scripts/i18n/index.ts @@ -0,0 +1,26 @@ +import de from './de'; +import en from './en'; +import fi from './fi'; +import tr from './tr'; +import { i18n } from '@smartface/i18n'; +import System from '@smartface/native/device/system'; + +new i18n({ + lng: Device.language, + debug: !!System.isEmulator, + resources: { + en: { + translation: en + }, + tr: { + translation: tr + }, + de: { + translation: de + }, + fi: { + translation: fi + } + }, + fallbackLng: 'en' +}); diff --git a/scripts/i18n/tr.ts b/scripts/i18n/tr.ts index 9d7f8ead..516b2a7f 100755 --- a/scripts/i18n/tr.ts +++ b/scripts/i18n/tr.ts @@ -1,4 +1,4 @@ -SMF.i18n.defineLanguage('tr', { +export default { verificationCode: 'Doğrulama Kodu', productDetail: 'Ürün Detayı', goToCheckout: 'Ödemeye Git', @@ -165,4 +165,4 @@ SMF.i18n.defineLanguage('tr', { trackOrder: 'Siparişi takip et', backHome: 'Anasayfaya geri dön', checkoutLoginError: 'Ödeme sayfasına gitmek için giriş yapmalısınız.' -}); +}; diff --git a/scripts/lib/checkoutDialog.ts b/scripts/lib/checkoutDialog.ts index aa9f4637..ac8c79e6 100644 --- a/scripts/lib/checkoutDialog.ts +++ b/scripts/lib/checkoutDialog.ts @@ -6,16 +6,17 @@ import router from 'routes'; import store from 'store/index'; import storeActions from 'store/main/actions'; import { CheckoutListItem } from 'types'; +import { i18n } from '@smartface/i18n'; let checkoutDialog = null; let activeDialogCounter = 0; function initDialog(totalCost: string | number) { const checkoutListItems: CheckoutListItem[] = [ - { title: global.lang.delivery, description: 'Home' }, - { title: global.lang.payment, description: global.lang.payAtTheDoor }, - { title: global.lang.promoCode, description: 'No Promo Code' }, - { title: global.lang.totalCost, description: totalCost.toString() } + { title: `${i18n.instance.t('delivery')}`, description: 'Home' }, + { title: `${i18n.instance.t('payment')}`, description: `${i18n.instance.t('payAtTheDoor')}` }, + { title: `${i18n.instance.t('promoCode')}`, description: 'No Promo Code' }, + { title: `${i18n.instance.t('totalCost')}`, description: totalCost.toString() } ] let dialog = new Dialog({ android: { @@ -26,9 +27,9 @@ function initDialog(totalCost: string | number) { const component = new FlCheckout(); component.items = checkoutListItems; - component.lblCheckout.text = global.lang.checkout; - component.lblTermsAndCond.text = global.lang.checkoutTermsAndCond; - component.btnPlaceOrder.text = global.lang.placeOrder; + component.lblCheckout.text = `${i18n.instance.t('checkout')}`; + component.lblTermsAndCond.text = `${i18n.instance.t('checkoutTermsAndCond')}`; + component.btnPlaceOrder.text = `${i18n.instance.t('placeOrder')}`; component.lblDissmisIcon.onTouchEnded = () => { hideCheckoutDialog(); return true; diff --git a/scripts/lib/deeplink.ts b/scripts/lib/deeplink.ts index 753cd422..c31fc62f 100644 --- a/scripts/lib/deeplink.ts +++ b/scripts/lib/deeplink.ts @@ -7,6 +7,7 @@ import { hideWaitDialog, showWaitDialog } from './waitDialog'; import config from 'config.json'; import getCurrentEnvironment from './getCurrentEnvironment'; import System from '@smartface/native/device/system'; +import { i18n } from '@smartface/i18n'; type ApplicationCallReceivedParams = { url: string; @@ -35,11 +36,11 @@ export async function productDetailHandler(productId: string) { productId: productId }); } else { - throw new Error(global.lang.productNotFound); + throw new Error(`${i18n.instance.t('productNotFound')}`); } } catch (error) { genericErrorHandler(error); - alert(global.lang.productNotFound); + alert(`${i18n.instance.t('productNotFound')}`); } finally { hideWaitDialog(); } diff --git a/scripts/lib/listView.ts b/scripts/lib/listView.ts index 341de284..3aad38b7 100644 --- a/scripts/lib/listView.ts +++ b/scripts/lib/listView.ts @@ -10,6 +10,7 @@ import Image from '@smartface/native/ui/image'; import Page from '@smartface/native/ui/page'; import { themeService } from 'theme'; import SwipeItem from '@smartface/native/ui/swipeitem'; +import { i18n } from '@smartface/i18n'; const isIOS = System.OS === System.OSType.IOS; const SwipeImages = { @@ -47,7 +48,7 @@ export function onRowSwipe(event, fieldName = 'data') { const dataId = page[fieldName][event.index].id; const deleteItem = initSwipeItem({ contextName: 'deleteItem', - text: global.lang.delete, + text: `${i18n.instance.t('delete')}`, onPress: properties.onDelete, className: '.swipeItem.delete', page: this, diff --git a/scripts/lib/profileImageMenu.ts b/scripts/lib/profileImageMenu.ts index c2e1764c..17b9a2e6 100644 --- a/scripts/lib/profileImageMenu.ts +++ b/scripts/lib/profileImageMenu.ts @@ -17,6 +17,8 @@ import Contacts from '@smartface/native/device/contacts'; import { NativeRouter as Router } from '@smartface/router'; import { themeService } from 'theme'; import { IImage } from '@smartface/native/ui/image/image'; +import { i18n } from '@smartface/i18n'; + //@ts-ignore const contactActivity = Contacts.onActivityResult; //@ts-ignore @@ -68,11 +70,11 @@ const updateImage = (params: IPhotoMenu): Promise => { return new Promise((resolve, reject) => { const menu = new Menu(); const menuItems = []; - menu.headerTitle = params.title ? params.title : global.lang.updatePhoto; + menu.headerTitle = params.title ? params.title : `${i18n.instance.t('updatePhoto')}`; const pictureDialog = initPictureDialog(params.imageUrl); menuItems.push( new MenuItem({ - title: global.lang.show, + title:`${i18n.instance.t('show')}`, onSelected: () => { pictureDialog.show(); } @@ -80,7 +82,7 @@ const updateImage = (params: IPhotoMenu): Promise => { ); menuItems.push( new MenuItem({ - title: global.lang.openCamera, + title: `${i18n.instance.t('openCamera')}`, onSelected: () => { onCameraSelect().then((base64: string) => { resolve(base64); @@ -90,7 +92,7 @@ const updateImage = (params: IPhotoMenu): Promise => { ); menuItems.push( new MenuItem({ - title: global.lang.selectFromGallery, + title: `${i18n.instance.t('selectFromGallery')}`, onSelected: () => { onGallerySelect().then((base64: string) => { resolve(base64); @@ -100,7 +102,7 @@ const updateImage = (params: IPhotoMenu): Promise => { ); if (System.OS === System.OSType.IOS) { const cancelMenuItem = new MenuItem({ - title: global.lang.cancel + title: `${i18n.instance.t('cancel')}` }); cancelMenuItem.ios.style = MenuItem.ios.Style.CANCEL; menuItems.push(cancelMenuItem); @@ -114,7 +116,7 @@ export const onCameraSelect = (opts: IPhotoEdit = {}) => { return permissionUtil .getPermission({ androidPermission: Application.Android.Permissions.CAMERA as any, - permissionText: global.lang.cameraPermissionFail, + permissionText: `${i18n.instance.t('cameraPermissionFail')}`, iosPermission: permissionUtil.IOS_PERMISSIONS.CAMERA }) .then(() => { @@ -137,10 +139,10 @@ export const onCameraSelect = (opts: IPhotoEdit = {}) => { android: { cropShape: opts.cropShape === 'RECTANGLE' ? Multimedia.Android.CropShape.RECTANGLE : Multimedia.Android.CropShape.OVAL, - rotateText: global.lang.rotate, - scaleText: global.lang.stretch, - cropText: global.lang.crop, - headerBarTitle: global.lang.photoEditHeaderTitle, + rotateText: `${i18n.instance.t('rotate')}`, + scaleText: `${i18n.instance.t('stretch')}`, + cropText: `${i18n.instance.t('crop')}`, + headerBarTitle: `${i18n.instance.t('photoEditHeaderTitle')}`, hideBottomControls: false }, page: Router.currentRouter.getState().view @@ -160,7 +162,7 @@ export const onGallerySelect = (opts: IPhotoEdit = {}) => { return permissionUtil .getPermission({ androidPermission: Application.Android.Permissions.READ_EXTERNAL_STORAGE as any, - permissionText: global.lang.galleryPermissionFail + permissionText: `${i18n.instance.t('galleryPermissionFail')}` }) .then(() => { return new Promise((resolve, reject) => { @@ -183,10 +185,10 @@ export const onGallerySelect = (opts: IPhotoEdit = {}) => { android: { cropShape: opts.cropShape === 'RECTANGLE' ? Multimedia.Android.CropShape.RECTANGLE : Multimedia.Android.CropShape.OVAL, - rotateText: global.lang.rotate, - scaleText: global.lang.stretch, - cropText: global.lang.crop, - headerBarTitle: global.lang.photoEditHeaderTitle, + rotateText: `${i18n.instance.t('rotate')}`, + scaleText: `${i18n.instance.t('stretch')}`, + cropText: `${i18n.instance.t('crop')}`, + headerBarTitle: `${i18n.instance.t('photoEditHeaderTitle')}`, hideBottomControls: false }, page: Router.currentRouter.getState().view diff --git a/scripts/lib/setHeaderIcon.ts b/scripts/lib/setHeaderIcon.ts index f524773c..945b0854 100644 --- a/scripts/lib/setHeaderIcon.ts +++ b/scripts/lib/setHeaderIcon.ts @@ -1,6 +1,7 @@ import FlexLayout from '@smartface/native/ui/flexlayout'; import FlHeaderIcon from 'components/FlHeaderIcon'; import { themeService } from 'theme'; +import { i18n } from '@smartface/i18n'; export default function setHeaderIcon(flHeaderIcon: FlHeaderIcon) { flHeaderIcon = new FlHeaderIcon(); @@ -9,6 +10,6 @@ export default function setHeaderIcon(flHeaderIcon: FlHeaderIcon) { type: 'pushClassNames', classNames: '.flHeaderIcon' }); - flHeaderIcon.appName = global.lang.appName; + flHeaderIcon.appName = `${i18n.instance.t('appName')}`; return flHeaderIcon; } diff --git a/scripts/lib/toast.ts b/scripts/lib/toast.ts index bbc2be31..fab07f99 100644 --- a/scripts/lib/toast.ts +++ b/scripts/lib/toast.ts @@ -2,6 +2,7 @@ import { themeService } from 'theme'; import Toast from '@smartface/native/ui/toast'; import Screen from '@smartface/native/device/screen'; import System from '@smartface/native/device/system'; +import { i18n } from '@smartface/i18n'; //header height ~ 55px, ios and android difference ~ 50px const bottomOffsetIOS = Screen.height - 150; @@ -12,7 +13,7 @@ const removeFromBasketBackground = themeService.getNativeStyle('.flProductItemBu export const addToBasketToast = () => { const myToastMessage = new Toast({ - message: global.lang.addedToBasket, + message: `${i18n.instance.t('addedToBasket')}`, bottomOffset: System.OS === System.OSType.ANDROID ? bottomOffsetAnd : bottomOffsetIOS, backgroundColor: addToBasketBackground, duration: 1 @@ -22,7 +23,7 @@ export const addToBasketToast = () => { export const removeFromBasketToast = () => { const myToastMessage = new Toast({ - message: global.lang.removedFromBasket, + message: `${i18n.instance.t('removedFromBasket')}`, bottomOffset: System.OS === System.OSType.ANDROID ? bottomOffsetAnd : bottomOffsetIOS, backgroundColor: removeFromBasketBackground, duration: 1 diff --git a/scripts/package.json b/scripts/package.json index bcd79ab0..602fd0a9 100755 --- a/scripts/package.json +++ b/scripts/package.json @@ -3,12 +3,13 @@ "@smartface/component-keyboardlayout": "^5.0.0", "@smartface/component-materialtextbox": "^7.0.2", "@smartface/extension-utils": "^16.2.9", - "@smartface/mixins": "^5.0.0", - "@smartface/native": "^5.0.0", + "@smartface/mixins": "5.0.3", + "@smartface/native": "5.0.2-alpha.5", "@smartface/router": "^2.3.1", "@smartface/source-map": "^5.0.0", - "@smartface/styling-context": "^5.0.0", + "@smartface/styling-context": "5.0.3", "redux": "^4.1.2", - "urijs": "^1.19.7" + "urijs": "^1.19.7", + "@smartface/i18n": "^5.0.2" } } diff --git a/scripts/pages/pgAccount.ts b/scripts/pages/pgAccount.ts index 6a06c7f7..d394ef9f 100644 --- a/scripts/pages/pgAccount.ts +++ b/scripts/pages/pgAccount.ts @@ -16,6 +16,8 @@ import { withDismissAndBackButton } from '@smartface/mixins'; import { getProfileImageUrl, putProfileImage } from 'service/commerce'; import AlertView from '@smartface/native/ui/alertview'; import {getAccessToken} from '../service/token'; +import { i18n } from '@smartface/i18n'; + type Processor = | ListViewItems.ProcessorTypes.ILviAccount | ListViewItems.ProcessorTypes.ILviProfile @@ -38,11 +40,11 @@ export default class PgAccount extends withDismissAndBackButton(PgAccountDesign) this.lvMain.onRowBind = onRowBind.bind(this); this.lvMain.onRowSelected = (item: LviAccount | LviProfile | LviRow2LineButton | LviSpacer, index) => { if (item instanceof LviAccount) { - if (item.itemTitle === global.lang.settings) { + if (item.itemTitle === `${i18n.instance.t('settings')}`) { this.router.push('settings'); - } else if (item.itemTitle === global.lang.notifications) { + } else if (item.itemTitle === `${i18n.instance.t('notifications')}`) { this.router.push('notifications'); - } else if(item.itemTitle === global.lang.myDetails){ + } else if(item.itemTitle === `${i18n.instance.t('myDetails')}`){ this.router.push('myDetails'); }else { alert({ @@ -84,9 +86,9 @@ export default class PgAccount extends withDismissAndBackButton(PgAccountDesign) } }) : ListViewItems.getLviRow2LineButton({ - mainButtonText: global.lang.loginHeader, - bottomLeftLabelText: global.lang.signup, - bottomRightLabelText: global.lang.forgotPassword, + mainButtonText: `${i18n.instance.t('loginHeader')}`, + bottomLeftLabelText: `${i18n.instance.t('signup')}`, + bottomRightLabelText: `${i18n.instance.t('forgotPassword')}`, mainOnClick: () => { this.router.push('pages/pgLogin'); }, @@ -127,11 +129,11 @@ export default class PgAccount extends withDismissAndBackButton(PgAccountDesign) initLogoutButton() { this.onExit = () => { alert({ - title: global.lang.warning, - message: global.lang.sureToLogout, + title: `${i18n.instance.t('warning')}`, + message: `${i18n.instance.t('sureToLogout')}`, buttons: [ { - text: global.lang.yes, + text: `${i18n.instance.t('yes')}`, type: AlertView.Android.ButtonType.POSITIVE, onClick: () => { store.dispatch(storeActions.logout()); @@ -139,7 +141,7 @@ export default class PgAccount extends withDismissAndBackButton(PgAccountDesign) } }, { - text: global.lang.cancel, + text: `${i18n.instance.t('cancel')}`, type: AlertView.Android.ButtonType.NEGATIVE, onClick: () => {} } @@ -173,6 +175,6 @@ export default class PgAccount extends withDismissAndBackButton(PgAccountDesign) this.initLogoutButton(); this.initListView(); this.headerBar.leftItemEnabled = false; - this.headerBar.title = global.lang.accountHeader; + this.headerBar.title = `${i18n.instance.t('accountHeader')}`; } } diff --git a/scripts/pages/pgAddAddress.ts b/scripts/pages/pgAddAddress.ts index e904c251..19aa30b6 100644 --- a/scripts/pages/pgAddAddress.ts +++ b/scripts/pages/pgAddAddress.ts @@ -2,25 +2,26 @@ import PgAddAddressDesign from 'generated/pages/pgAddAddress'; import { withDismissAndBackButton } from '@smartface/mixins'; import { Router, Route } from '@smartface/router'; import { themeService } from 'theme'; +import { i18n } from '@smartface/i18n'; export default class PgAddAddress extends withDismissAndBackButton(PgAddAddressDesign) { constructor(private router?: Router, private route?: Route) { super({}); - this.flAddAddress.btnAddAddress.text = global.lang.save; + this.flAddAddress.btnAddAddress.text = `${i18n.instance.t('save')}`; } initMaterialTextBoxes(){ this.flAddAddress.mtbName.options = { - hint: global.lang.firstName + hint: `${i18n.instance.t('firstName')}` } this.flAddAddress.mtbLastName.options = { - hint: global.lang.lastName + hint: `${i18n.instance.t('lastName')}` } this.flAddAddress.mtbAddress.options = { - hint: global.lang.address, + hint: `${i18n.instance.t('address')}`, multiline:true, } this.flAddAddress.mtbTitle.options = { - hint: global.lang.addressTitle + hint: `${i18n.instance.t('addressTitle')}` } } public onShow() { @@ -32,7 +33,7 @@ export default class PgAddAddress extends withDismissAndBackButton(PgAddAddressD public onLoad() { super.onLoad?.(); - this.headerBar.title = global.lang.addAddress; + this.headerBar.title = `${i18n.instance.t('addAddress')}`; this.initMaterialTextBoxes(); } diff --git a/scripts/pages/pgAddReview.ts b/scripts/pages/pgAddReview.ts index f381cd6d..b24ecacc 100644 --- a/scripts/pages/pgAddReview.ts +++ b/scripts/pages/pgAddReview.ts @@ -8,6 +8,7 @@ import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; import Button from '@smartface/native/ui/button'; import store from 'store'; import storeActions from 'store/main/actions'; +import { i18n } from '@smartface/i18n'; export default class PgAddReview extends withDismissAndBackButton(PgAddReviewDesign) { product: Product; @@ -26,11 +27,11 @@ export default class PgAddReview extends withDismissAndBackButton(PgAddReviewDes }); } initButton() { - this.btnSendReview.text = global.lang.addReview; + this.btnSendReview.text = `${i18n.instance.t('addReview')}`; } initMaterialTextBox() { this.flRateProduct.mtbComment.options = { - hint: global.lang.comment, + hint: `${i18n.instance.t('comment')}`, multiline: true }; this.flRateProduct.mtbComment.materialTextBox.onTextChanged = () => { @@ -43,13 +44,13 @@ export default class PgAddReview extends withDismissAndBackButton(PgAddReviewDes const response = await postProductReview(productId, star, comment); this.router.goBack(); alert({ - title: global.lang.reviewHeader, - message: global.lang.reviewSent + title: `${i18n.instance.t('reviewHeader')}`, + message: `${i18n.instance.t('reviewSent')}` }); } catch (error) { alert({ - title: global.lang.warning, - message: global.lang.alreadySendReview + title: `${i18n.instance.t('warning')}`, + message: `${i18n.instance.t('alreadySendReview')}` }); } finally { hideWaitDialog(); @@ -65,7 +66,7 @@ export default class PgAddReview extends withDismissAndBackButton(PgAddReviewDes public onLoad() { super.onLoad?.(); - this.headerBar.title = global.lang.addReviewHeader; + this.headerBar.title = `${i18n.instance.t('addReviewHeader')}`; this.product = this.route.getState().routeData?.product; this.initMaterialTextBox(); this.initButton(); diff --git a/scripts/pages/pgAddress.ts b/scripts/pages/pgAddress.ts index d6caf7df..9c53f9ea 100644 --- a/scripts/pages/pgAddress.ts +++ b/scripts/pages/pgAddress.ts @@ -5,6 +5,7 @@ import { themeService } from 'theme'; import { onRowBind, onRowCreate, onRowHeight, onRowSwipe, onRowType } from 'lib/listView'; import * as ListViewItems from 'lib/listViewItemTypes'; import HeaderBarItem from '@smartface/native/ui/headerbaritem'; +import { i18n } from '@smartface/i18n'; type Processor = | ListViewItems.ProcessorTypes.ILviNoAddress | ListViewItems.ProcessorTypes.ILviAddressList; @@ -41,8 +42,8 @@ export default class PgAddress extends withDismissAndBackButton(PgAddressDesign) if (!this.hasAddress) { processorItems.push(ListViewItems.getLviNoAddress({ image: 'images://location.png', - title: global.lang.noAddressTitle, - buttonText: global.lang.addAddress + title: `${i18n.instance.t('noAddressTitle')}`, + buttonText: `${i18n.instance.t('addAddress')}` })); } else { @@ -60,7 +61,7 @@ export default class PgAddress extends withDismissAndBackButton(PgAddressDesign) addHeaderRightItem() { if (this.hasAddress) { this.rightItemAdd = new HeaderBarItem({ - title: global.lang.addAddress, + title: `${i18n.instance.t('addAddress')}`, color: themeService.getNativeStyle('.sf-headerBar.main').itemColor, onPress: () => { this.router.push('addAddress') @@ -82,7 +83,7 @@ export default class PgAddress extends withDismissAndBackButton(PgAddressDesign) public onLoad() { super.onLoad?.(); - this.headerBar.title = global.lang.addressBook; + this.headerBar.title = `${i18n.instance.t('addressBook')}`; this.initListView(); } diff --git a/scripts/pages/pgCart.ts b/scripts/pages/pgCart.ts index 59d41e2c..687f4b94 100644 --- a/scripts/pages/pgCart.ts +++ b/scripts/pages/pgCart.ts @@ -12,6 +12,7 @@ import setVisibility from 'lib/setVisibility'; import { moneyFormatter } from 'lib/moneyFormatter'; import { showCheckoutDialog } from 'lib/checkoutDialog'; import {getAccessToken} from '../service/token'; +import { i18n } from '@smartface/i18n'; type Processor = ListViewItems.ProcessorTypes.ILviCartItem | ListViewItems.ProcessorTypes.ILviCartItem; @@ -29,16 +30,16 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { this.flCartCheckout.onCheckoutClick = () => { if(!getAccessToken()){ alert({ - title: global.lang.warning, - message: global.lang.checkoutLoginError, + title: `${i18n.instance.t('warning')}`, + message: `${i18n.instance.t('checkoutLoginError')}`, buttons: [ { - text: global.lang.cancel, + text: `${i18n.instance.t('cancel')}`, type: AlertView.Android.ButtonType.NEGATIVE, onClick: () => {} }, { - text: global.lang.login, + text: `${i18n.instance.t('login')}`, type: AlertView.Android.ButtonType.POSITIVE, onClick: () => { router.push('pages/pgLogin'); @@ -84,7 +85,7 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { processorItems.push( ListViewItems.getLviEmptyItem({ emptyImage: 'images://empty_cart.png', - emptyTitle: global.lang.shoppingCartIsEmpty + emptyTitle: `${i18n.instance.t('shoppingCartIsEmpty')}` }) ); } else { @@ -108,11 +109,11 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { }, onRemoveAction: () => { alert({ - title: global.lang.delete, - message: global.lang.sureToDelete, + title: `${i18n.instance.t('delete')}`, + message: `${i18n.instance.t('sureToDelete')}`, buttons: [ { - text: global.lang.delete, + text: `${i18n.instance.t('delete')}`, type: AlertView.Android.ButtonType.POSITIVE, onClick: () => { this.cartOperation(cart, CartOperationEnum.Clear); @@ -120,7 +121,7 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { } }, { - text: global.lang.cancel, + text: `${i18n.instance.t('cancel')}`, type: AlertView.Android.ButtonType.NEGATIVE, onClick: () => {} } @@ -137,7 +138,7 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { } calculateCheckoutPrice() { if (store.getState().main.basket.length > 0) { - this.flCartCheckout.checkoutTitle = global.lang.goToCheckout; + this.flCartCheckout.checkoutTitle =`${i18n.instance.t('goToCheckout')}`; this.flCartCheckout.checkoutPrice = store .getState() .main.basket.reduce((total, product) => { @@ -172,7 +173,7 @@ export default class PgCart extends withDismissAndBackButton(PgCartDesign) { onLoad() { super.onLoad(); this.headerBar.leftItemEnabled = false; - this.headerBar.title = global.lang.mycartHeader; + this.headerBar.title = `${i18n.instance.t('mycartHeader')}`; this.initListView(); } } diff --git a/scripts/pages/pgCategories.ts b/scripts/pages/pgCategories.ts index 6b794078..60d8fda5 100644 --- a/scripts/pages/pgCategories.ts +++ b/scripts/pages/pgCategories.ts @@ -7,6 +7,7 @@ import System from '@smartface/native/device/system'; import { themeService } from 'theme'; import { getCategories } from 'service/commerce'; import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; +import { i18n } from '@smartface/i18n'; export default class PgCategories extends withDismissAndBackButton(PgCategoriesDesign) { categories: Categories[]; @@ -54,7 +55,7 @@ export default class PgCategories extends withDismissAndBackButton(PgCategoriesD this.refreshGridView(); } } catch (error) { - alert(global.lang.categoriesServiceError); + alert(`${i18n.instance.t('categoriesServiceError')}`); } finally { this.categoriesGrid.stopRefresh(); this.initialized = true; @@ -70,7 +71,7 @@ export default class PgCategories extends withDismissAndBackButton(PgCategoriesD } onLoad() { super.onLoad(); - this.headerBar.title = global.lang.categoriesHeader; + this.headerBar.title = `${i18n.instance.t('categoriesHeader')}`; this.headerBar.leftItemEnabled = false; this.initCategoriesGrid(); } diff --git a/scripts/pages/pgCategoryDetail.ts b/scripts/pages/pgCategoryDetail.ts index 2978a694..71793c61 100644 --- a/scripts/pages/pgCategoryDetail.ts +++ b/scripts/pages/pgCategoryDetail.ts @@ -14,6 +14,8 @@ import { getProductImageUrl, getProductsByQuery, getShowcases } from 'service/co import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; import { ON_SHOW_TIMEOUT } from 'constants'; import setVisibility from 'lib/setVisibility'; +import { i18n } from '@smartface/i18n'; + const gridViewItemLength = themeService.getNativeStyle('.flProductItem').height; type searchStatus = { isSearchActive: boolean; @@ -115,7 +117,7 @@ export default class PgCategoryDetail extends withDismissAndBackButton(PgCategor this.refreshGridView(); } } catch (error) { - alert(global.lang.productServiceError); + alert(`${i18n.instance.t('productServiceError')}`); } finally { this.initialized = true; this.paginating = false; @@ -132,7 +134,7 @@ export default class PgCategoryDetail extends withDismissAndBackButton(PgCategor } return showcaseResponse; } catch (error) { - throw new Error(global.lang.showcaseServiceError); + throw new Error(`${i18n.instance.t('showcaseServiceError')}`); } } @@ -216,9 +218,9 @@ export default class PgCategoryDetail extends withDismissAndBackButton(PgCategor checkIfListEmpty() { if (this.categoryProducts.length === 0) { if (this.searchStatus.isSearchActive) { - this.flEmptyItem.emptyTitle = `${global.lang.categoriesIsEmptyWithSearch} ${this.searchStatus.searchText}`; + this.flEmptyItem.emptyTitle = `${`${i18n.instance.t('categoriesIsEmptyWithSearch')}`} ${this.searchStatus.searchText}`; } else { - this.flEmptyItem.emptyTitle = global.lang.categoriesIsEmpty; + this.flEmptyItem.emptyTitle = `${i18n.instance.t('categoriesIsEmpty')}`; } setVisibility(this.flEmptyItem, true); } else { diff --git a/scripts/pages/pgCheckoutSuccessful.ts b/scripts/pages/pgCheckoutSuccessful.ts index dff6d321..c30dd8fd 100644 --- a/scripts/pages/pgCheckoutSuccessful.ts +++ b/scripts/pages/pgCheckoutSuccessful.ts @@ -3,6 +3,7 @@ import { withDismissAndBackButton } from '@smartface/mixins'; import { onRowBind, onRowCreate, onRowHeight, onRowSwipe, onRowType } from 'lib/listView'; import { Router, Route } from '@smartface/router'; import * as ListViewItems from 'lib/listViewItemTypes'; +import { i18n } from '@smartface/i18n'; type Processor = ListViewItems.ProcessorTypes.ILviCheckoutSuccessful; @@ -30,10 +31,10 @@ export default class PgCheckoutSuccessful extends withDismissAndBackButton(PgChe const processorItems = []; processorItems.push(ListViewItems.getLviCheckoutSuccessful({ image: 'images://csuccessful.png', - title: global.lang.orderAccepted, - description: global.lang.onDelivery, - btnTrackOrderText: global.lang.trackOrder, - backHome: global.lang.backHome + title: `${i18n.instance.t('orderAccepted')}`, + description: `${i18n.instance.t('onDelivery')}`, + btnTrackOrderText: `${i18n.instance.t('trackOrder')}`, + backHome: `${i18n.instance.t('backHome')}` })); return processorItems; } diff --git a/scripts/pages/pgFavorites.ts b/scripts/pages/pgFavorites.ts index 9f549ca5..215eb77c 100644 --- a/scripts/pages/pgFavorites.ts +++ b/scripts/pages/pgFavorites.ts @@ -12,6 +12,7 @@ import { themeService } from 'theme'; import setVisibility from 'lib/setVisibility'; import { Product } from 'types'; import { moneyFormatter } from 'lib/moneyFormatter'; +import { i18n } from '@smartface/i18n'; type Processor = ListViewItems.ProcessorTypes.ILviFavorites; enum HeaderEnum { @@ -31,7 +32,7 @@ export default class PgFavorites extends withDismissAndBackButton(PgFavoritesDes super({}); } initAddToCartButton() { - this.flCartCheckout.checkoutTitle = global.lang.addToBasket; + this.flCartCheckout.checkoutTitle = `${i18n.instance.t('addToBasket')}`; setVisibility(this.flCartCheckout.lblCartCheckoutPrice, false); } addToCartSelectedProducts() { @@ -67,7 +68,7 @@ export default class PgFavorites extends withDismissAndBackButton(PgFavoritesDes } addCancelToHeaderBar() { this.rightItemCancel = new HeaderBarItem({ - title: global.lang.cancel, + title: `${i18n.instance.t('cancel')}`, color: themeService.getNativeStyle('.sf-headerBar.cancel').itemColor, onPress: () => { this.changeHeaderText = false; @@ -80,7 +81,7 @@ export default class PgFavorites extends withDismissAndBackButton(PgFavoritesDes this.rightItemSelect = new HeaderBarItem({ //Native › NTVE-435 color: themeService.getNativeStyle('.sf-headerBar.main').itemColor, - title: global.lang.select, + title: `${i18n.instance.t('select')}`, onPress: () => { this.changeHeaderText = true; this.refreshListView(); @@ -164,7 +165,7 @@ export default class PgFavorites extends withDismissAndBackButton(PgFavoritesDes processorItems.push( ListViewItems.getLviEmptyItem({ emptyImage: 'images://empty_favorite.png', - emptyTitle: global.lang.favoritesIsEmpty + emptyTitle: `${i18n.instance.t('deliveryfavoritesIsEmpty')}` }) ); } else { @@ -207,6 +208,6 @@ export default class PgFavorites extends withDismissAndBackButton(PgFavoritesDes this.initListView(); this.refreshListView(); this.headerBar.leftItemEnabled = false; - this.headerBar.title = global.lang.favouriteHeader; + this.headerBar.title = `${i18n.instance.t('favouriteHeader')}`; } } diff --git a/scripts/pages/pgHome.ts b/scripts/pages/pgHome.ts index db382178..8093ff4c 100644 --- a/scripts/pages/pgHome.ts +++ b/scripts/pages/pgHome.ts @@ -14,6 +14,7 @@ import LviGenericSlider from 'components/LviGenericSlider'; import { BANNER_ASPECT_RATIO, HOME_PRODUCT_LIMIT } from 'constants'; import FlHeaderIcon from 'components/FlHeaderIcon'; import setHeaderIcon from 'lib/setHeaderIcon'; +import { i18n } from '@smartface/i18n'; type Processor = | ListViewItems.ProcessorTypes.ILviHomeProducts @@ -64,7 +65,7 @@ export default class PgHome extends withDismissAndBackButton(PgHomeDesign) { processorItems.push( ListViewItems.getLviShowcaseHeader({ showcaseTitle: showcase.title, - showcaseLinkText: global.lang.seeAll.replace('$1', showcase.products.length), + showcaseLinkText: `${i18n.instance.t('seeAll')}`.replace('$1', showcase.products.length.toString()), onSeeAllClick: () => { this.router.push('categoryDetail', { dataId: showcase._id, @@ -123,7 +124,7 @@ export default class PgHome extends withDismissAndBackButton(PgHomeDesign) { const productResponse = await getProductsByQuery({ page: opts.pageNumber, limit: HOME_PRODUCT_LIMIT }); this.products = productResponse.products; } catch (error) { - throw new Error(global.lang.productServiceError); + throw new Error(`${i18n.instance.t('productServiceError')}`); } finally { hideWaitDialog(); } @@ -138,7 +139,7 @@ export default class PgHome extends withDismissAndBackButton(PgHomeDesign) { } return showcaseResponse; } catch (error) { - throw new Error(global.lang.showcaseServiceError); + throw new Error(`${i18n.instance.t('showcaseServiceError')}`); } } @@ -147,7 +148,7 @@ export default class PgHome extends withDismissAndBackButton(PgHomeDesign) { showWaitDialog(); this.categories = await getCategories(); } catch (error) { - throw new Error(global.lang.categoriesServiceError); + throw new Error(`${i18n.instance.t('categoriesServiceError')}`); } finally { hideWaitDialog(); } @@ -161,7 +162,7 @@ export default class PgHome extends withDismissAndBackButton(PgHomeDesign) { } return bannersResponse; } catch (error) { - throw new Error(global.lang.bannerServiceError); + throw new Error(`${i18n.instance.t('bannerServiceError')}`); } } async initAutoLogin() { diff --git a/scripts/pages/pgMyDetails.ts b/scripts/pages/pgMyDetails.ts index e1dd832f..3f018788 100644 --- a/scripts/pages/pgMyDetails.ts +++ b/scripts/pages/pgMyDetails.ts @@ -5,6 +5,7 @@ import { themeService } from 'theme'; import { onRowBind, onRowCreate, onRowHeight, onRowType } from 'lib/listView'; import { getLviAccount } from 'lib/listViewItemTypes'; import LviAccount from 'components/LviAccount'; +import { i18n } from '@smartface/i18n'; export default class PgMyDetails extends withDismissAndBackButton(PgMyDetailsDesign) { @@ -21,7 +22,7 @@ export default class PgMyDetails extends withDismissAndBackButton(PgMyDetailsDes this.lvMain.onRowType = onRowType.bind(this); this.lvMain.onRowBind = onRowBind.bind(this); this.lvMain.onRowSelected = (item:LviAccount) => { - if (item.itemTitle === global.lang.addressBook) { + if (item.itemTitle === `${i18n.instance.t('addressBook')}`) { this.router.push('addressInformation'); } @@ -51,7 +52,7 @@ export default class PgMyDetails extends withDismissAndBackButton(PgMyDetailsDes public onLoad() { super.onLoad?.(); - this.headerBar.title = global.lang.myDetails; + this.headerBar.title = `${i18n.instance.t('myDetails')}`; this.initListView(); } } diff --git a/scripts/pages/pgNotifications.ts b/scripts/pages/pgNotifications.ts index c0bb9004..11b7ac3f 100644 --- a/scripts/pages/pgNotifications.ts +++ b/scripts/pages/pgNotifications.ts @@ -4,6 +4,7 @@ import { getLviRow1LineLarge } from 'lib/listViewItemTypes'; import { Router, Route } from '@smartface/router'; import { withDismissAndBackButton } from '@smartface/mixins'; import { themeService } from 'theme'; +import { i18n } from '@smartface/i18n'; export default class PgNotifications extends withDismissAndBackButton(PgNotificationsDesign) { private data: ReturnType[]; @@ -49,7 +50,7 @@ export default class PgNotifications extends withDismissAndBackButton(PgNotifica } onLoad() { super.onLoad(); - this.headerBar.title = global.lang.notifications; + this.headerBar.title = `${i18n.instance.t('notifications')}`; this.initListView(); } } diff --git a/scripts/pages/pgNumber.ts b/scripts/pages/pgNumber.ts index 2a10691f..467f67f6 100644 --- a/scripts/pages/pgNumber.ts +++ b/scripts/pages/pgNumber.ts @@ -5,6 +5,7 @@ import { themeService } from 'theme'; import { Router, Route } from '@smartface/router'; import { withDismissAndBackButton } from '@smartface/mixins'; import Button from '@smartface/native/ui/button'; +import { i18n } from '@smartface/i18n'; export default class PgNumber extends withDismissAndBackButton(PgNumberDesign) { leftItem: HeaderBarItem; @@ -14,12 +15,12 @@ export default class PgNumber extends withDismissAndBackButton(PgNumberDesign) { this.btnRoute.on('press', () => { this.router.push('pgVerification'); }); - this.lblTitle.text = global.lang.enterMobilNumberText; - this.lblText.text = global.lang.mobileNumber; + this.lblTitle.text = `${i18n.instance.t('enterMobilNumberText')}`; + this.lblText.text = `${i18n.instance.t('mobileNumber')}`; } initMaterialTextBox() { this.mtbNumber.options = { - text: global.lang.phoneCode + text: `${i18n.instance.t('phoneCode')}` }; this.mtbNumber.materialTextBox.keyboardType = KeyboardType.NUMBER; } diff --git a/scripts/pages/pgNutritions.ts b/scripts/pages/pgNutritions.ts index e9a259ec..847c5e3a 100644 --- a/scripts/pages/pgNutritions.ts +++ b/scripts/pages/pgNutritions.ts @@ -5,6 +5,7 @@ import { themeService } from 'theme'; import * as ListViewItems from 'lib/listViewItemTypes'; import { onRowBind, onRowCreate, onRowHeight, onRowType } from 'lib/listView'; import { Nutritions } from 'types'; +import { i18n } from '@smartface/i18n'; type Processor = ListViewItems.ProcessorTypes.ILviEmptyItem | ListViewItems.ProcessorTypes.ILviNutritions; export default class PgNutritions extends withDismissAndBackButton(PgNutritionsDesign) { @@ -24,7 +25,7 @@ export default class PgNutritions extends withDismissAndBackButton(PgNutritionsD super.onLoad?.(); this.getNutritions(); this.initListView(); - this.headerBar.title = global.lang.nutritions; + this.headerBar.title = `${i18n.instance.t('nutritions')}`; } getNutritions() { this.nutritions = this.route.getState().routeData.product?.nutritions; @@ -48,7 +49,7 @@ export default class PgNutritions extends withDismissAndBackButton(PgNutritionsD processorItems.push( ListViewItems.getLviEmptyItem({ emptyImage: 'images://empty_nutritions_list.png', - emptyTitle: global.lang.emptyNutritions + emptyTitle: `${i18n.instance.t('emptyNutritions')}` }) ); } else { diff --git a/scripts/pages/pgProductDescription.ts b/scripts/pages/pgProductDescription.ts index c85cf5cb..691e2a29 100644 --- a/scripts/pages/pgProductDescription.ts +++ b/scripts/pages/pgProductDescription.ts @@ -4,6 +4,7 @@ import { Router, Route } from '@smartface/router'; import { themeService } from 'theme'; import { onRowBind, onRowCreate, onRowHeight, onRowType } from 'lib/listView'; import * as ListViewItems from 'lib/listViewItemTypes'; +import { i18n } from '@smartface/i18n'; type Processor = ListViewItems.ProcessorTypes.ILviDescription; @@ -22,7 +23,7 @@ export default class PgProductDescription extends withDismissAndBackButton(PgPro public onLoad() { super.onLoad?.(); this.initListView(); - this.headerBar.title = global.lang.productDetail; + this.headerBar.title = `${i18n.instance.t('productDetail')}`; } initListView() { this.lvMain.onRowType = onRowType.bind(this); @@ -47,7 +48,7 @@ export default class PgProductDescription extends withDismissAndBackButton(PgPro : processorItems.push( ListViewItems.getLviEmptyItem({ emptyImage: 'images://empty_description.png', - emptyTitle: global.lang.emptyDescription + emptyTitle: `${i18n.instance.t('emptyDescription')}` }) ); return processorItems; diff --git a/scripts/pages/pgProductDetail.ts b/scripts/pages/pgProductDetail.ts index a2335717..720a589b 100644 --- a/scripts/pages/pgProductDetail.ts +++ b/scripts/pages/pgProductDetail.ts @@ -17,6 +17,7 @@ import { generateProductDeeplinkUrl } from 'lib/deeplink'; import LviPdInfoSection from 'components/LviPdInfoSection'; import { ON_SHOW_TIMEOUT } from 'constants'; import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; +import { i18n } from '@smartface/i18n'; type Processor = | ListViewItems.ProcessorTypes.ILviGenericSlider @@ -56,11 +57,11 @@ export default class PgProductDetail extends withDismissAndBackButton(PgProductD this.lvMain.refreshEnabled = false; this.lvMain.onRowSelected = (item: LviPdOverviewSection | LviPdInfoSection, index) => { if (item instanceof LviPdOverviewSection || item instanceof LviPdInfoSection) { - if (item.overviewTitle === global.lang.reviews) { + if (item.overviewTitle === `${i18n.instance.t('reviews')}`) { this.router.push('reviews', { productId: this.product._id, product: this.product }); - } else if (item.overviewTitle === global.lang.nutritions) { + } else if (item.overviewTitle === `${i18n.instance.t('nutritions')}`) { this.router.push('nutritions', { productId: this.product._id, product: this.product }); - } else if (item.overviewTitle === global.lang.productDetail) { + } else if (item.overviewTitle === `${i18n.instance.t('productDetail')}`) { this.router.push('description', { productDescription: this.product.description }); } } @@ -132,19 +133,19 @@ export default class PgProductDetail extends withDismissAndBackButton(PgProductD processorItems.push(ListViewItems.getLviSpacerItem({ className: 'xSmall' })); processorItems.push( ListViewItems.getLviPdInfoSection({ - overviewTitle: global.lang.productDetail, + overviewTitle: `${i18n.instance.t('productDetail')}`, productInfo: this.product.description }) ); processorItems.push( ListViewItems.getLviPdOverviewSection({ - overviewTitle: global.lang.nutritions, + overviewTitle: `${i18n.instance.t('nutritions')}`, showRating: false }) ); processorItems.push( ListViewItems.getLviPdOverviewSection({ - overviewTitle: global.lang.reviews, + overviewTitle: `${i18n.instance.t('reviews')}`, star: this.product?.rating, reviewCount: `(${this.product?.reviews?.length})`, showRating: this.product?.rating ? true : false @@ -163,7 +164,7 @@ export default class PgProductDetail extends withDismissAndBackButton(PgProductD } return productResponse; } catch (error) { - throw new Error(global.lang.productServiceError); + throw new Error(`${i18n.instance.t('productServiceError')}`); } finally { this.refreshListView(); hideWaitDialog(); @@ -181,8 +182,8 @@ export default class PgProductDetail extends withDismissAndBackButton(PgProductD onLoad() { super.onLoad(); - this.headerBar.title = global.lang.productDetail; - this.btnAddToBasket.text = global.lang.addToBasket; + this.headerBar.title = `${i18n.instance.t('productDetail')}`; + this.btnAddToBasket.text = `${i18n.instance.t('addToBasket')}`; this.addToBasket(); this.initListView(); } diff --git a/scripts/pages/pgReviews.ts b/scripts/pages/pgReviews.ts index c50929b2..c0a9ff0a 100644 --- a/scripts/pages/pgReviews.ts +++ b/scripts/pages/pgReviews.ts @@ -11,6 +11,7 @@ import HeaderBarItem from '@smartface/native/ui/headerbaritem'; import Image from '@smartface/native/ui/image'; import store from 'store'; import { hideWaitDialog, showWaitDialog } from 'lib/waitDialog'; +import { i18n } from '@smartface/i18n'; type Processor = | ListViewItems.ProcessorTypes.ILviReviewProduct[] @@ -68,7 +69,7 @@ export default class PgReviews extends withDismissAndBackButton(PgReviewsDesign) processorItems.push( ListViewItems.getLviEmptyItem({ emptyImage: 'images://empty_star.png', - emptyTitle: global.lang.emptyReviewList + emptyTitle: `${i18n.instance.t('emptyReviewList')}` }) ); } else { @@ -121,7 +122,7 @@ export default class PgReviews extends withDismissAndBackButton(PgReviewsDesign) } return reviewsResponse; } catch (error) { - throw new Error(global.lang.reviewsServiceError); + throw new Error(`${i18n.instance.t('reviewsServiceError')}`); } finally { this.initialized = true; this.refreshListView(); @@ -154,7 +155,7 @@ export default class PgReviews extends withDismissAndBackButton(PgReviewsDesign) public onLoad() { super.onLoad?.(); - this.headerBar.title = global.lang.reviews; + this.headerBar.title = `${i18n.instance.t('reviews')}`; this.initListView(); } } diff --git a/scripts/pages/pgUserSettings.ts b/scripts/pages/pgUserSettings.ts index 3a0bc554..eea847e0 100644 --- a/scripts/pages/pgUserSettings.ts +++ b/scripts/pages/pgUserSettings.ts @@ -7,6 +7,7 @@ import PgUserSettingsDesign from 'generated/pages/pgUserSettings'; import { themeService } from 'theme'; import { Router, Route } from '@smartface/router'; import { withDismissAndBackButton } from '@smartface/mixins'; +import { i18n } from '@smartface/i18n'; export default class PgUserSettings extends withDismissAndBackButton(PgUserSettingsDesign) { private data: ReturnType[]; @@ -31,7 +32,7 @@ export default class PgUserSettings extends withDismissAndBackButton(PgUserSetti refreshListView() { const themeItem = getLviRow1LineLarge({ image: 'images://ayarlar_karanlikmod.png', - title: global.lang.changeTheme, + title: `${i18n.instance.t('changeTheme')}`, showSeparator: true, themeSwitch: true, onTouchEnded: () => { @@ -65,7 +66,7 @@ export default class PgUserSettings extends withDismissAndBackButton(PgUserSetti } onShow() { super.onShow(); - this.headerBar.title = global.lang.settingsHeader; + this.headerBar.title = `${i18n.instance.t('settingsHeader')}`; this.refreshListView(); this.initBackButton(this.router, { color: themeService.getNativeStyle('.sf-headerBar.main').itemColor diff --git a/scripts/pages/pgVerification.ts b/scripts/pages/pgVerification.ts index 97fb3078..9bf35bb3 100644 --- a/scripts/pages/pgVerification.ts +++ b/scripts/pages/pgVerification.ts @@ -6,6 +6,7 @@ import PgVerificationDesign from 'generated/pages/pgVerification'; const { image } = themeService.getNativeStyle('.sf-headerBar.back'); import { Router, Route } from '@smartface/router'; import { withDismissAndBackButton } from '@smartface/mixins'; +import { i18n } from '@smartface/i18n'; export default class PgVerification extends withDismissAndBackButton(PgVerificationDesign) { leftItem: HeaderBarItem; @@ -15,13 +16,13 @@ export default class PgVerification extends withDismissAndBackButton(PgVerificat this.btnRouter.on('press', () => { this.router.push('pgLogin'); }); - this.lblTitle.text = global.lang.enterdigitcode; - this.lblText.text = global.lang.code; - this.lblResend.text = global.lang.resendCode; + this.lblTitle.text = `${i18n.instance.t('enterdigitcode')}`; + this.lblText.text = `${i18n.instance.t('code')}`; + this.lblResend.text = `${i18n.instance.t('resendCode')}`; } initMaterialTextBox() { this.mtbNumber.options = { - hint: global.lang.verificationCode + hint: `${i18n.instance.t('verificationCode')}` }; this.mtbNumber.materialTextBox.keyboardType = KeyboardType.NUMBER; } diff --git a/scripts/routes/tabbar.ts b/scripts/routes/tabbar.ts index 929b747b..6fe9b19d 100644 --- a/scripts/routes/tabbar.ts +++ b/scripts/routes/tabbar.ts @@ -7,6 +7,8 @@ import { themeService } from 'theme'; import BottomTabBarController from '@smartface/native/ui/bottomtabbarcontroller'; import * as Pages from 'pages'; import System from '@smartface/native/device/system'; +import { i18n } from '@smartface/i18n'; + const { backgroundColor, itemColor } = themeService.getNativeStyle('.tabs'); themeService.onChange(() => { @@ -19,7 +21,7 @@ themeService.onChange(() => { }); const btbItemCart = new TabBarItem(); -btbItemCart.title = global.lang.cart; +btbItemCart.title = `${i18n.instance.t('cart')}`; btbItemCart.badge.backgroundColor = itemColor.selected; btbItemCart.badge.visible = false; btbItemCart.icon = Image.createFromFile('images://tabiconcart.png'); @@ -36,7 +38,7 @@ store.subscribe(() => { } }); const btbItemFavorite = new TabBarItem(); -btbItemFavorite.title = global.lang.favourite; +btbItemFavorite.title = `${i18n.instance.t('favourite')}`; btbItemFavorite.badge.backgroundColor = itemColor.selected; btbItemFavorite.badge.visible = false; btbItemFavorite.icon = Image.createFromFile('images://tabiconfavorite.png'); @@ -141,11 +143,11 @@ const bottomTabBarRouter = BottomTabBarRouter.of({ backgroundColor: backgroundColor }), items: [ - { title: global.lang.shop, icon: Image.createFromFile('images://tabiconhome.png') }, - { title: global.lang.explore, icon: Image.createFromFile('images://tabiconexplore.png') }, + { title: `${i18n.instance.t('shop')}`, icon: Image.createFromFile('images://tabiconhome.png') }, + { title: `${i18n.instance.t('explore')}`, icon: Image.createFromFile('images://tabiconexplore.png') }, btbItemCart, btbItemFavorite, - { title: global.lang.account, icon: Image.createFromFile('images://tabiconuser.png') } + { title: `${i18n.instance.t('account')}`, icon: Image.createFromFile('images://tabiconuser.png') } ], // tab1 routes: [ diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 0d7abd53..130fe5fb 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@babel/runtime@^7.17.2": + version "7.18.3" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4" + integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug== + dependencies: + regenerator-runtime "^0.13.4" + "@babel/runtime@^7.9.2": version "7.17.9" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.9.tgz#d19fbf802d01a8cb6cf053a64e472d42c434ba72" @@ -28,10 +35,10 @@ "@smartface/styler" "^2.0.0" filtrex "^0.5.4" -"@smartface/core@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@smartface/core/-/core-5.0.0.tgz#86878626f65b4d523edeee7cc420935f4c017e16" - integrity sha512-8gLF/jiIudv8wlOfLIVurMdYt7829TEYf0eDgfy0aNaI0pfGHXKgyUvUrfYFCif9ixBmBd/ajfq1GRH01Jc6dQ== +"@smartface/core@^5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@smartface/core/-/core-5.0.3.tgz#8b63e5fb4551c147351a53dada6a8420cc3fc36d" + integrity sha512-obOGFpJeO4CcK/rIaZpw82/DaT2FHreVqeW61S8mKjPHuTsZfgkTnwxU8r0nQDgWPes82ZrkMAMqjwNkW7vzTQ== "@smartface/extension-utils@^16.2.9": version "16.4.1" @@ -54,17 +61,32 @@ dependencies: html-parse-stringify "1.0.2" -"@smartface/mixins@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@smartface/mixins/-/mixins-5.0.0.tgz#c466757a5d722764f40ec6fb1739541ac0f6ebc9" - integrity sha512-p/9mQDDmzabEs7VdBe1MG3lu76to2ctTCU8OVDAWVJ+lrg8xM+w6cgu435bWiKM53VBpYt8eri4i36iAX97K2Q== +"@smartface/i18n@^5.0.2": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@smartface/i18n/-/i18n-5.0.3.tgz#ccdedd15016ecb2045fdfdd81e72564ed05d9319" + integrity sha512-ZXB5+LNDxc83QFVsqnBm4Be8zFZ81tU0OHMV/IfZSiAMiaOMkZ5B/8o6d3LrQzuSkjjt4WOABUKJhJbGGliucg== + dependencies: + "@smartface/native" "^5.0.0" + i18next "21.6.15" + +"@smartface/mixins@5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@smartface/mixins/-/mixins-5.0.3.tgz#25326de44559577ade5cafe9dc1df71af13fb1b4" + integrity sha512-hpwJkGlgf45ssx6zu7+OBrTltZtf8YkVuyOQyCx+ojGQ33xBakcraOTCoa98tS2kqvxyQRq/fBKvcCVzs4CvvQ== dependencies: - "@smartface/core" "^5.0.0" + "@smartface/core" "^5.0.3" + +"@smartface/native@5.0.2-alpha.5": + version "5.0.2-alpha.5" + resolved "https://registry.yarnpkg.com/@smartface/native/-/native-5.0.2-alpha.5.tgz#ab5e5fb25c918c11b5d9f5604756841c83b9c670" + integrity sha512-sNk8760a+GoG4RZmfYNPhHO4UpB+oB3cvaKRpanARhQv6BxEHzs5BOndH+/XCInnTOisDG/SpgRK40SFqGPnPg== + dependencies: + events "^3.3.0" "@smartface/native@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@smartface/native/-/native-5.0.0.tgz#1f1390f88d0065a1cb026c6ad4ccfaaaa7344c12" - integrity sha512-l+pxcPhaPD7nXHZjd59t7K/tOYOWqaHb8YZgfRNn97e8qLNwc3QDQ6uhsfQqOYLBFRH0+6OKU0AVRCX80TLHqw== + version "5.0.1" + resolved "https://registry.yarnpkg.com/@smartface/native/-/native-5.0.1.tgz#f7087f2581e04b16781375d99e8b1ae8e0ba29d2" + integrity sha512-MAbFr6zCWJDHZ9vE0bDqc9rEEo0IIvkoM5XeehLDIJ8BFJBkUWtFrSaJh4FoX4RPCDI9FtU03jKlNcixLvIe8w== dependencies: events "^3.3.0" @@ -88,10 +110,10 @@ resolved "https://registry.yarnpkg.com/@smartface/styler/-/styler-2.0.3.tgz#e144b4054faeffa4fa0432af0d84f48664dddee2" integrity sha512-GNYwWDQamYd6Qka9sI1kjZTsWbxEjPSRKlHOYLBaGT/CJfRXt7BOPyZS5yO8/6J/2LAdZE5VOko9By3fuJ+bWA== -"@smartface/styling-context@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@smartface/styling-context/-/styling-context-5.0.0.tgz#6a1a46b42f1740943bec283993be1aa01f2777e4" - integrity sha512-TRz/rJDW320NHa1JoxYBZCayKXqj8RhenUwwl1VcM5HOk0YpA8k84R38nShMownhrJ5zjgwX6tb5ngT546BG8Q== +"@smartface/styling-context@5.0.3": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@smartface/styling-context/-/styling-context-5.0.3.tgz#7e954115ea55c0e8606c1560b7ae27b14313a5d3" + integrity sha512-aZcnTkH2rd1ifC+x3MPGQXU/Ya0eQxEmVNEo0OCIasa1bJMYU7+XerucGS401Yl3ZPBRf62KzaDpGkxdgWh/Pg== dependencies: "@smartface/contx" "^4.2.0" "@smartface/styler" "^2.0.0" @@ -140,6 +162,13 @@ html-parse-stringify@1.0.2: dependencies: void-elements "^1.0.0" +i18next@21.6.15: + version "21.6.15" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.6.15.tgz#077e5798dbbd53d3aaa8ad66193758bd19836dbe" + integrity sha512-uMFyw5HGK9KSJ7ok/WUJfeNQj53VOR4NoITtErffWen2v2SjJfpCls7tKTLF1nTCdKRePY4lCoZMLKhRSj/1GA== + dependencies: + "@babel/runtime" "^7.17.2" + is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"