| @@ -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]) |