PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | app/Services/DiscountService.php +7 -3 3.0.8 → 3.0.16 View file →
@@ -868,12 +868,16 @@
868 868 */
869 869 private function formatDiscountAmount($discount): string {
870 870 $amount = $discount->group_discount_amount ?? 0;
871 871 if ($discount->group_discount_type === 'percentage') {
872 - return "{$amount}% off";
873 - } else {
874 - return "$" . number_format((float) $amount, 2) . " off";
872 + /* translators: %s: discount percentage. */
873 + return sprintf(__('%s%% off', 'yatra'), $amount);
875 874 }
875 +
876 + // Was a hardcoded "$" with default separators, so every non-dollar site
877 + // showed the wrong currency (and the label could not be translated).
878 + /* translators: %s: discount amount, already formatted with the site currency. */
879 + return sprintf(__('%s off', 'yatra'), yatra_format_price((float) $amount, null, false));
876 880 }
877 881
878 882 /**
879 883 * @param array $travelerCounts Array of category_id => count (e.g., ['3' => 4, '5' => 1])