Skip to content

Commit 491d41d

Browse files
committed
translations
1 parent 2d6c3c0 commit 491d41d

File tree

22 files changed

+277
-9
lines changed

22 files changed

+277
-9
lines changed

app/base/controllers/Frontend/Commerce/Cart/Discount.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use App\Base\Abstracts\Controllers\FrontendPageWithLang;
2020
use App\Base\Models\CartDiscount;
2121
use App\Base\Models\Discount as DiscountModel;
22+
use App\Base\Models\Language;
2223
use Symfony\Component\HttpFoundation\Response;
2324
use RuntimeException;
2425

@@ -84,7 +85,7 @@ public function beforeRender() : BasePage|Response
8485

8586
try {
8687
if (!isJson($actionDetails)) {
87-
throw new RuntimeException($this->getUtils()->translate('No action details provided.'));
88+
throw new RuntimeException($this->getUtils()->translate('No action details provided.', locale: $this->getCurrentLocale()));
8889
}
8990

9091
$actionDetails = json_decode($actionDetails, true);
@@ -95,7 +96,7 @@ public function beforeRender() : BasePage|Response
9596
if (isset($actionDetails['action']) && $actionDetails['action'] === 'apply_discount') {
9697
$discountCode = $actionDetails['discount_code'] ?? '';
9798
if (empty($discountCode)) {
98-
throw new RuntimeException($this->getUtils()->translate('Discount code is required.'));
99+
throw new RuntimeException($this->getUtils()->translate('Discount code is required.', locale: $this->getCurrentLocale()));
99100
}
100101

101102
$discount = DiscountModel::getCollection()
@@ -107,13 +108,13 @@ public function beforeRender() : BasePage|Response
107108
->getFirst();
108109

109110
if (!$discount) {
110-
throw new RuntimeException($this->getUtils()->translate('Invalid or inactive discount code.'));
111+
throw new RuntimeException($this->getUtils()->translate('Invalid or inactive discount code.', locale: $this->getCurrentLocale()));
111112
}
112113

113114
$this->getCart()->fullLoad();
114115

115116
if (in_array($discount->getId(), array_map(fn($d) => $d->getInitialDiscountId(), $this->getCart()->getDiscounts() ?? []))) {
116-
throw new RuntimeException($this->getUtils()->translate('Discount code already applied.'));
117+
throw new RuntimeException($this->getUtils()->translate('Discount code already applied.', locale: $this->getCurrentLocale()));
117118
}
118119

119120
try {
@@ -127,33 +128,33 @@ public function beforeRender() : BasePage|Response
127128
$this->getCart()->calculate()->persist();
128129

129130
$this->addSuccessFlashMessage(
130-
$this->getUtils()->translate('Discount applied successfully.')
131+
$this->getUtils()->translate('Discount applied successfully.', locale: $this->getCurrentLocale())
131132
);
132133
} catch (\Exception $e) {
133134
throw new RuntimeException(
134-
$this->getUtils()->translate('Failed to apply discount: ' . $e->getMessage())
135+
$this->getUtils()->translate('Failed to apply discount: ' . $e->getMessage(), locale: $this->getCurrentLocale())
135136
);
136137
}
137138
}
138139

139140
if (isset($actionDetails['action']) && $actionDetails['action'] === 'remove_discount') {
140141
$discountId = $actionDetails['discount_id'] ?? null;
141142
if (!$discountId) {
142-
throw new RuntimeException($this->getUtils()->translate('Discount ID is required to remove a discount.'));
143+
throw new RuntimeException($this->getUtils()->translate('Discount ID is required to remove a discount.', locale: $this->getCurrentLocale()));
143144
}
144145

145146
$cartDiscount = CartDiscount::load($discountId);
146147
if (!$cartDiscount) {
147148
throw new RuntimeException($this->getUtils()->translate('Discount not found.'));
148149
}
149150
if ($cartDiscount->getCartId() !== $this->getCart()->getId()) {
150-
throw new RuntimeException($this->getUtils()->translate('Discount does not belong to this cart.'));
151+
throw new RuntimeException($this->getUtils()->translate('Discount does not belong to this cart.', locale: $this->getCurrentLocale()));
151152
}
152153

153154
$cartDiscount->delete();
154155
$this->getCart()->calculate()->persist();
155156
$this->addSuccessFlashMessage(
156-
$this->getUtils()->translate('Discount removed successfully.')
157+
$this->getUtils()->translate('Discount removed successfully.', locale: $this->getCurrentLocale())
157158
);
158159
}
159160

translations/ar.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,4 +353,17 @@
353353
'Notes for delivery' => 'ملاحظات للتسليم',
354354
'Order Confirmation' => 'تأكيد الطلب',
355355
'Website is currently offline' => 'الموقع غير متصل حالياً',
356+
'Tax Amount' => 'قيمة الضريبة',
357+
'Cart updated successfully.' => 'تم تحديث السلة بنجاح.',
358+
'Discount removed successfully.' => 'تم إزالة الخصم بنجاح.',
359+
'Discount applied successfully.' => 'تم تطبيق الخصم بنجاح.',
360+
'Invalid or inactive discount code.' => 'رمز الخصم غير صالح أو غير نشط.',
361+
'Cart Item removed successfully.' => 'تمت إزالة المنتج من السلة بنجاح.',
362+
'Product added to cart successfully.' => 'تمت إضافة المنتج إلى السلة بنجاح.',
363+
'Discount code already applied.' => 'تم تطبيق رمز الخصم بالفعل.',
364+
'No action details provided.' => 'لم يتم تقديم تفاصيل الإجراء.',
365+
'Discount code is required.' => 'رمز الخصم مطلوب.',
366+
'Failed to apply discount: %s' => 'فشل تطبيق الخصم: %s',
367+
'Discount ID is required to remove a discount.' => 'مطلوب معرف الخصم لإزالة الخصم.',
368+
'Discount does not belong to this cart.' => 'الخصم لا ينتمي إلى هذه السلة.',
356369
];

translations/bn.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,4 +380,17 @@
380380
'Notes for delivery' => 'ডেলিভারির জন্য নোট',
381381
'Order Confirmation' => 'অর্ডার নিশ্চিতকরণ',
382382
'Website is currently offline' => 'ওয়েবসাইট বর্তমানে অফলাইনে আছে',
383+
'Tax Amount' => 'কর পরিমাণ',
384+
'Cart updated successfully.' => 'কার্ট সফলভাবে আপডেট হয়েছে।',
385+
'Discount removed successfully.' => 'ছাড় সফলভাবে সরানো হয়েছে।',
386+
'Discount applied successfully.' => 'ছাড় সফলভাবে প্রয়োগ করা হয়েছে।',
387+
'Invalid or inactive discount code.' => 'অবৈধ বা নিষ্ক্রিয় ডিসকাউন্ট কোড।',
388+
'Cart Item removed successfully.' => 'কার্টের আইটেম সফলভাবে সরানো হয়েছে।',
389+
'Product added to cart successfully.' => 'পণ্য সফলভাবে কার্টে যোগ করা হয়েছে।',
390+
'Discount code already applied.' => 'ডিসকাউন্ট কোড ইতিমধ্যেই প্রয়োগ করা হয়েছে।',
391+
'No action details provided.' => 'কোনো কার্যক্রমের বিস্তারিত দেওয়া হয়নি।',
392+
'Discount code is required.' => 'ডিসকাউন্ট কোড প্রয়োজন।',
393+
'Failed to apply discount: %s' => 'ডিসকাউন্ট প্রয়োগে ব্যর্থ: %s',
394+
'Discount ID is required to remove a discount.' => 'ডিসকাউন্ট সরাতে ডিসকাউন্ট ID প্রয়োজন।',
395+
'Discount does not belong to this cart.' => 'ডিসকাউন্ট এই কার্টের সাথে সম্পর্কিত নয়।',
383396
];

translations/de.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'Hinweise zur Lieferung',
379379
'Order Confirmation' => 'Bestellbestätigung',
380380
'Website is currently offline' => 'Die Website ist derzeit offline',
381+
'Tax Amount' => 'Steuerbetrag',
382+
'Cart updated successfully.' => 'Warenkorb erfolgreich aktualisiert.',
383+
'Discount removed successfully.' => 'Rabatt erfolgreich entfernt.',
384+
'Discount applied successfully.' => 'Rabatt erfolgreich angewendet.',
385+
'Invalid or inactive discount code.' => 'Ungültiger oder inaktiver Rabattcode.',
386+
'Cart Item removed successfully.' => 'Artikel aus dem Warenkorb erfolgreich entfernt.',
387+
'Product added to cart successfully.' => 'Produkt erfolgreich zum Warenkorb hinzugefügt.',
388+
'Discount code already applied.' => 'Rabattcode bereits angewendet.',
389+
'No action details provided.' => 'Keine Aktionsdetails angegeben.',
390+
'Discount code is required.' => 'Rabattcode ist erforderlich.',
391+
'Failed to apply discount: %s' => 'Anwenden des Rabatts fehlgeschlagen: %s',
392+
'Discount ID is required to remove a discount.' => 'Rabatt-ID ist erforderlich, um einen Rabatt zu entfernen.',
393+
'Discount does not belong to this cart.' => 'Der Rabatt gehört nicht zu diesem Warenkorb.',
381394
];

translations/el.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'Σημειώσεις για την παράδοση',
379379
'Order Confirmation' => 'Επιβεβαίωση Παραγγελίας',
380380
'Website is currently offline' => 'Ο ιστότοπος είναι προσωρινά εκτός λειτουργίας',
381+
'Tax Amount' => 'Ποσό Φόρου',
382+
'Cart updated successfully.' => 'Το καλάθι ενημερώθηκε επιτυχώς.',
383+
'Discount removed successfully.' => 'Η έκπτωση αφαιρέθηκε επιτυχώς.',
384+
'Discount applied successfully.' => 'Η έκπτωση εφαρμόστηκε επιτυχώς.',
385+
'Invalid or inactive discount code.' => 'Μη έγκυρος ή ανενεργός κωδικός έκπτωσης.',
386+
'Cart Item removed successfully.' => 'Το προϊόν αφαιρέθηκε επιτυχώς από το καλάθι.',
387+
'Product added to cart successfully.' => 'Το προϊόν προστέθηκε επιτυχώς στο καλάθι.',
388+
'Discount code already applied.' => 'Ο κωδικός έκπτωσης έχει ήδη εφαρμοστεί.',
389+
'No action details provided.' => 'Δεν παρέχονται λεπτομέρειες ενέργειας.',
390+
'Discount code is required.' => 'Απαιτείται κωδικός έκπτωσης.',
391+
'Failed to apply discount: %s' => 'Αποτυχία εφαρμογής της έκπτωσης: %s',
392+
'Discount ID is required to remove a discount.' => 'Απαιτείται ID έκπτωσης για να αφαιρεθεί η έκπτωση.',
393+
'Discount does not belong to this cart.' => 'Η έκπτωση δεν ανήκει σε αυτό το καλάθι.',
381394
];

translations/en.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'Notes for delivery',
379379
'Order Confirmation' => 'Order Confirmation',
380380
'Website is currently offline' => 'Website is currently offline',
381+
'Tax Amount' => 'Tax Amount',
382+
'Cart updated successfully.' => 'Carrito actualizado correctamente.',
383+
'Discount removed successfully.' => 'Descuento eliminado correctamente.',
384+
'Discount applied successfully.' => 'Descuento aplicado correctamente.',
385+
'Invalid or inactive discount code.' => 'Código de descuento inválido o inactivo.',
386+
'Cart Item removed successfully.' => 'Artículo del carrito eliminado correctamente.',
387+
'Product added to cart successfully.' => 'Producto añadido al carrito correctamente.',
388+
'Discount code already applied.' => 'Discount code already applied.',
389+
'No action details provided.' => 'No action details provided.',
390+
'Discount code is required.' => 'Discount code is required.',
391+
'Failed to apply discount: %s' => 'Failed to apply discount: %s',
392+
'Discount ID is required to remove a discount.' => 'Discount ID is required to remove a discount.',
393+
'Discount does not belong to this cart.' => 'Discount does not belong to this cart.',
381394
];

translations/es.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,11 @@
378378
'Notes for delivery' => 'Notas para la entrega',
379379
'Order Confirmation' => 'Confirmación de pedido',
380380
'Website is currently offline' => 'El sitio web está actualmente fuera de línea',
381+
'Tax Amount' => 'Importe del impuesto',
382+
'Discount code already applied.' => 'Código de descuento ya aplicado.',
383+
'No action details provided.' => 'No se proporcionaron detalles de la acción.',
384+
'Discount code is required.' => 'Se requiere código de descuento.',
385+
'Failed to apply discount: %s' => 'No se pudo aplicar el descuento: %s',
386+
'Discount ID is required to remove a discount.' => 'Se requiere el ID del descuento para eliminar un descuento.',
387+
'Discount does not belong to this cart.' => 'El descuento no pertenece a este carrito.',
381388
];

translations/fr.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'Notes pour la livraison',
379379
'Order Confirmation' => 'Confirmation de commande',
380380
'Website is currently offline' => 'Le site est actuellement hors ligne',
381+
'Tax Amount' => 'Montant de la taxe',
382+
'Cart updated successfully.' => 'Panier mis à jour avec succès.',
383+
'Discount removed successfully.' => 'Remise supprimée avec succès.',
384+
'Discount applied successfully.' => 'Remise appliquée avec succès.',
385+
'Invalid or inactive discount code.' => 'Code de réduction invalide ou inactif.',
386+
'Cart Item removed successfully.' => 'Article du panier supprimé avec succès.',
387+
'Product added to cart successfully.' => 'Produit ajouté au panier avec succès.',
388+
'Discount code already applied.' => 'Code de réduction déjà appliqué.',
389+
'No action details provided.' => 'Aucun détail d’action fourni.',
390+
'Discount code is required.' => 'Le code de réduction est requis.',
391+
'Failed to apply discount: %s' => 'Échec de l’application du rabais : %s',
392+
'Discount ID is required to remove a discount.' => 'L’ID du rabais est requis pour supprimer un rabais.',
393+
'Discount does not belong to this cart.' => 'Le rabais n’appartient pas à ce panier.',
381394
];

translations/hi.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'डिलीवरी के लिए नोट्स',
379379
'Order Confirmation' => 'ऑर्डर पुष्टि',
380380
'Website is currently offline' => 'वेबसाइट वर्तमान में ऑफलाइन है',
381+
'Tax Amount' => 'कर राशि',
382+
'Cart updated successfully.' => 'कार्ट सफलतापूर्वक अपडेट किया गया।',
383+
'Discount removed successfully.' => 'छूट सफलतापूर्वक हटा दी गई।',
384+
'Discount applied successfully.' => 'छूट सफलतापूर्वक लागू की गई।',
385+
'Invalid or inactive discount code.' => 'अमान्य या निष्क्रिय डिस्काउंट कोड।',
386+
'Cart Item removed successfully.' => 'कार्ट आइटम सफलतापूर्वक हटाया गया।',
387+
'Product added to cart successfully.' => 'उत्पाद सफलतापूर्वक कार्ट में जोड़ा गया।',
388+
'Discount code already applied.' => 'डिस्काउंट कोड पहले ही लागू किया जा चुका है।',
389+
'No action details provided.' => 'कोई क्रिया विवरण प्रदान नहीं किया गया।',
390+
'Discount code is required.' => 'डिस्काउंट कोड आवश्यक है।',
391+
'Failed to apply discount: %s' => 'डिस्काउंट लागू करने में विफल: %s',
392+
'Discount ID is required to remove a discount.' => 'डिस्काउंट हटाने के लिए डिस्काउंट ID आवश्यक है।',
393+
'Discount does not belong to this cart.' => 'डिस्काउंट इस कार्ट का हिस्सा नहीं है।',
381394
];

translations/hu.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,17 @@
378378
'Notes for delivery' => 'Megjegyzések a szállításhoz',
379379
'Order Confirmation' => 'Rendelés megerősítése',
380380
'Website is currently offline' => 'A weboldal jelenleg offline állapotban van',
381+
'Tax Amount' => 'Adó összege',
382+
'Cart updated successfully.' => 'A kosár sikeresen frissítve.',
383+
'Discount removed successfully.' => 'A kedvezmény sikeresen eltávolítva.',
384+
'Discount applied successfully.' => 'A kedvezmény sikeresen alkalmazva.',
385+
'Invalid or inactive discount code.' => 'Érvénytelen vagy inaktív kedvezménykód.',
386+
'Cart Item removed successfully.' => 'A kosárból a tétel sikeresen eltávolítva.',
387+
'Product added to cart successfully.' => 'A termék sikeresen hozzáadva a kosárhoz.',
388+
'Discount code already applied.' => 'A kedvezménykód már alkalmazva van.',
389+
'No action details provided.' => 'Nincsenek megadva akció részletek.',
390+
'Discount code is required.' => 'A kedvezménykód kötelező.',
391+
'Failed to apply discount: %s' => 'A kedvezmény alkalmazása sikertelen: %s',
392+
'Discount ID is required to remove a discount.' => 'A kedvezmény eltávolításához kedvezményazonosító szükséges.',
393+
'Discount does not belong to this cart.' => 'A kedvezmény nem tartozik ehhez a kosárhoz.',
381394
];

0 commit comments

Comments
 (0)