diff --git a/package.json b/package.json index f546177d..aaefc1e0 100755 --- a/package.json +++ b/package.json @@ -128,4 +128,4 @@ "call-number": {} } } -} +} \ No newline at end of file diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json new file mode 100644 index 00000000..5d3dfdcd --- /dev/null +++ b/src/assets/i18n/es.json @@ -0,0 +1,67 @@ +{ + "Home": "Principal", + "Category": "Categorias", + "Offers": "Ofertas", + "MyCart": "Carrito de Compras", + "Your Orders": "Tus Ordenes", + "Favourite": "Favoritos", + "Settings": "Ajustes", + "News": "Noticias", + "Contact": "Contactos", + "Login": "Acceder", + "Logout": "Salir", + "Featured Product": "Productos Destacados", + "Categories": "Categorias", + "Beverages": "Bebidas", + "Appetizers": "Snacks", + "Salads": "Ensaladas", + "Sides":"Lados", + "Desserts":"Postres", + "Main Course":"Plato principal", + "Starters":"Entradas", + "Slice":"Rebanada", + "ADD TO CART": "AÑADIR AL CARRITO", + "Size and prices": "Tamaño y Precios", + "CHECKOUT": "REVISA TU COMPRA", + "KEEP SHOPPING": "SEGUIR COMPRANDO", + "Cart": "Carrito", + "Continue": "Continuar", + "Other Taxes (3%)": "Otros Impustos (3%)", + "Total VAT (5%)": "Total IVA (5%)", + "Coupons": "Copones", + "Apply Coupon": "Applicar Cupon", + "Price Subtotal": "Subtotal", + "Order Total": "Total", + "Payment Options": "Opciones de Pago", + "Address": "Direccion", + "ENTER ADDRESS": "AGREGAR DIRECCION", + "Payment": "Pago", + "COD": "COD", + "CARD": "TARJETA", + "Check Out": "Pagar", + "Send": "Enviar", + "Message:": "Mensage:", + "Email:": "Correo:", + "Name:": "Nombre:", + "Contact Us": "Contacta con nosotros", + "Contact": "Contacto", + "Thank You": "Gracias", + "Thank you !": "Gracias !", + "We love our customers and we value your business. we want to thank you for giving us the opportunity to serve you. Our customer service always open to hear feedback from you.thanks you!": "Amamos a nuestros clientes y valoramos su negocio. Queremos agradecerle por darnos la oportunidad de servirle. Nuestro servicio al cliente siempre está abierto para escuchar sus comentarios. Gracias!", + "Settings": "Ajustes", + "Your Name": "Tu Nombre", + "Languages": "Idioma", + "Notifications": "Notificaciones", + "Card Number:": "Numero de Tarjeta:", + "Name on card:": "Nombre en Tarjeta:", + "CVV:": "CVV:", + "Date of expiry:": "Fecha de Expiración:", + "Save": "Guardar", + "Offers": "Ofertas", + "Original Price :": "Precio Original :", + "Offer Price :": "Precio Oferta :", + "Product Description :": "Descripción de Producto:", + "Buy Now": "Compra Ahora", + "News": "Noticias", + "News-details": "Nuevos-detalles" + } \ No newline at end of file diff --git a/src/pages/address-list/address-list.ts b/src/pages/address-list/address-list.ts index 338eea53..1b8589ab 100755 --- a/src/pages/address-list/address-list.ts +++ b/src/pages/address-list/address-list.ts @@ -30,6 +30,7 @@ export class AddressListPage { cart: Array; orderDetails: any = {}; pincodes: Array; + addresses: AngularFireList; public pincodeMatched: boolean = false; public loyaltyPercentage: number = 0; public loyaltyPoints: number = 0; @@ -58,9 +59,8 @@ export class AddressListPage { this.navCtrl.push("CartPage"); } if (this.af.auth.currentUser) { - this.db - .list("/users/" + this.af.auth.currentUser.uid + "/address") - .snapshotChanges() + this.addresses=this.db.list("/users/" + this.af.auth.currentUser.uid + "/address"); + this.addresses.snapshotChanges() .pipe( map(changes => changes.map(c => ({ $key: c.payload.key, ...c.payload.val() })) diff --git a/src/pages/favourite/favourite.ts b/src/pages/favourite/favourite.ts index 30e7ff2b..ca630c32 100755 --- a/src/pages/favourite/favourite.ts +++ b/src/pages/favourite/favourite.ts @@ -1,7 +1,7 @@ import { Component } from "@angular/core"; import { IonicPage, NavController, ToastController } from "ionic-angular"; import { AngularFireAuth } from "@angular/fire/auth"; -import { AngularFireDatabase } from "@angular/fire/database"; +import { AngularFireDatabase, AngularFireList } from "@angular/fire/database"; import { map } from "rxjs/operators"; @IonicPage() @@ -13,7 +13,7 @@ export class FavouritePage { favouriteItems: any[] = []; Cart: any[]; noOfItems: number; - + favourites: AngularFireList; constructor( public af: AngularFireAuth, public db: AngularFireDatabase, @@ -23,9 +23,8 @@ export class FavouritePage { this.Cart = JSON.parse(localStorage.getItem("Cart")); this.noOfItems = this.Cart != null ? this.Cart.length : null; if (this.af.auth.currentUser) { - this.db - .list("/users/" + this.af.auth.currentUser.uid + "/favourite/") - .snapshotChanges() + this.favourites=this.db.list("/users/" + this.af.auth.currentUser.uid + "/favourite/"); + this.favourites.snapshotChanges() .pipe( map(changes => changes.map(c => ({ $key: c.payload.key, ...c.payload.val() })) diff --git a/src/pages/offer/offer.ts b/src/pages/offer/offer.ts index 17d73b68..42b261a0 100755 --- a/src/pages/offer/offer.ts +++ b/src/pages/offer/offer.ts @@ -1,6 +1,6 @@ import { Component, ViewChild } from "@angular/core"; import { IonicPage, NavController, Slides } from "ionic-angular"; -import { AngularFireDatabase } from "@angular/fire/database"; +import { AngularFireDatabase, AngularFireList } from "@angular/fire/database"; import { map } from "rxjs/operators"; @IonicPage() @@ -11,12 +11,13 @@ import { map } from "rxjs/operators"; export class OfferPage { @ViewChild(Slides) slides: Slides; offerData: Array; + offers:AngularFireList; public currency: {}; constructor(public af: AngularFireDatabase, public navCtrl: NavController) { this.currency = JSON.parse(localStorage.getItem('currency')); - this.af.list("/menuItems", ref => ref.orderByChild("offer").equalTo(true)) - .snapshotChanges() + this.offers=this.af.list("/menuItems", ref => ref.orderByChild("offer").equalTo(true)); + this.offers.snapshotChanges() .pipe( map(changes => changes.map(c => ({ key: c.payload.key, ...c.payload.val() })) diff --git a/src/pages/order-list/order-list.ts b/src/pages/order-list/order-list.ts index 5ca3eb0f..5ea27f53 100755 --- a/src/pages/order-list/order-list.ts +++ b/src/pages/order-list/order-list.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { IonicPage, NavController, LoadingController } from "ionic-angular"; import { AngularFireAuth } from "@angular/fire/auth"; -import { AngularFireDatabase } from "@angular/fire/database"; +import { AngularFireDatabase, AngularFireList } from "@angular/fire/database"; import { map } from "rxjs/operators"; @IonicPage() @@ -12,6 +12,7 @@ import { map } from "rxjs/operators"; export class OrderListPage { ordersDetails: any[] = []; + orders_list:AngularFireList; public noOfItems: number; public currency: {}; @@ -28,9 +29,8 @@ export class OrderListPage { }); loader.present().then(() => { let userID = this.af.auth.currentUser.uid; - this.db - .list("/orders", ref => ref.orderByChild("userId").equalTo(userID)) - .snapshotChanges() + this.orders_list=this.db.list("/orders", ref => ref.orderByChild("userId").equalTo(userID)); + this.orders_list.snapshotChanges() .pipe( map(changes => changes.map(c => ({ $key: c.payload.key, ...c.payload.val() })) diff --git a/src/pages/settings/settings.ts b/src/pages/settings/settings.ts index 23721861..38949e04 100755 --- a/src/pages/settings/settings.ts +++ b/src/pages/settings/settings.ts @@ -23,6 +23,10 @@ export class Settings { url: any = "assets/img/profile.jpg"; value: any; options = [ + { + language: "ESPAÑOL", + value: "es" + }, { language: "ENGLISH", value: "en" @@ -73,7 +77,7 @@ export class Settings { contentType: "image/*" }; let loader = this.loadingCtrl.create({ - content: "please wait.." + content: "Espere porfavor.." }); loader.present(); this.storageRef @@ -101,6 +105,9 @@ export class Settings { } else if (this.value == "ar") { this.platform.setDir("rtl", true); this.translate.use("ar"); + } else if (this.value == "es") { + this.platform.setDir("ltr", true); + this.translate.use("es"); } else { this.platform.setDir("ltr", true); this.translate.use("en"); @@ -118,7 +125,7 @@ export class Settings { mobileNo: this.user.mobileNo }) .then(() => { - this.createToaster("user information updated successfully", 3000); + this.createToaster("Informacion Actualizada", 3000); this.events.publish("imageUrl", this.user); }); }