Skip to content

Commit

Permalink
Implemented: locale support in the app(hotwax#106)
Browse files Browse the repository at this point in the history
Used the locale string from the order to be used in the app, as app does not have any functionality to change locale
  • Loading branch information
ymaheshwari1 committed Dec 4, 2024
1 parent 0b064bc commit 43b77fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
"Save changes": "Save changes",
"Save shipping address": "Save shipping address",
"Select pickup location": "Select pickup location",
"Shipping": "Shipping",
"Shipping address": "Shipping address",
"Showing pickup locations near": "Showing pickup locations near",
"Something went wrong while fetching stores": "Something went wrong while fetching stores",
"Something went wrong while fetching the order details": "Something went wrong while fetching the order details",
"Settings": "Settings",
"State": "State",
"Store pickup": "Store pickup",
"Street": "Street",
"Tracking code": "Tracking code",
"Username": "Username",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@
"Save changes": "Guardar cambios",
"Save shipping address": "Guardar dirección de envío",
"Select pickup location": "Seleccionar ubicación de recogida",
"Shipping": "Envío",
"Shipping address": "Dirección de envío",
"Showing pickup locations near": "Mostrando ubicaciones de recogida cercanas a",
"Something went wrong while fetching stores": "Algo salió mal al obtener las tiendas",
"Something went wrong while fetching the order details": "Algo salió mal al obtener los detalles del pedido",
"Settings": "Configuraciones",
"State": "Estado",
"Store pickup": "Recogida en tienda",
"Street": "Calle",
"Tracking code": "Código de seguimiento",
"Username": "Nombre de usuario",
Expand Down
5 changes: 3 additions & 2 deletions src/views/Order.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</ion-item> -->
<ion-item>
<ion-select :label="$t('Delivery method')" :disabled="!hasPermission(Actions.APP_SHPGRP_DLVRMTHD_UPDATE)" interface="popover" :value="shipGroup.selectedShipmentMethodTypeId" @ionChange="updateDeliveryMethod($event, shipGroup)">
<ion-select-option v-for="method in deliveryMethods" :key="method.value" :value="method.value">{{ method.name }}</ion-select-option>
<ion-select-option v-for="method in deliveryMethods" :key="method.value" :value="method.value">{{ $t(method.name) }}</ion-select-option>
</ion-select>
</ion-item>
<ion-button v-if="shipGroup.shipmentMethodTypeId === 'STOREPICKUP' && shipGroup.selectedShipmentMethodTypeId !== shipGroup.shipmentMethodTypeId && !shipGroup.updatedAddress" :disabled="!hasPermission(Actions.APP_SHPGRP_DLVRADR_UPDATE) && shipGroup.shipmentMethodTypeId !== 'STOREPICKUP'" @click="updateDeliveryAddress(shipGroup)" expand="block" fill="outline">{{ $t("Add address") }}</ion-button>
Expand Down Expand Up @@ -113,7 +113,7 @@ import { defineComponent } from "vue";
import { useRouter } from "vue-router";
import { mapGetters, useStore } from 'vuex'
import { OrderService } from "@/services/OrderService";
import { translate } from "@/i18n";
import i18n, { translate } from "@/i18n";
import { hasError, showToast } from "@/utils";
import Image from "@/components/Image.vue";
import AddressModal from "@/views/AddressModal.vue";
Expand Down Expand Up @@ -212,6 +212,7 @@ export default defineComponent({
});
if (!hasError(resp) && resp.data.id) {
order = resp.data;
i18n.global.locale = order.localeString || "en";
const productIds: any = new Set();
order.shipGroup = order.shipGroup.filter((group: any) => {
if(group.facilityId === 'PICKUP_REJECTED') {
Expand Down

0 comments on commit 43b77fd

Please sign in to comment.