Fix i18n deprecation notice for translating too early

This commit is contained in:
David Stone
2025-02-15 15:06:43 -07:00
parent 6d7e7cef66
commit eb29a438a5
26 changed files with 98 additions and 104 deletions

View File

@ -85,7 +85,7 @@ function wu_get_currencies(): array {
function wu_get_currency_symbol($currency = '') {
if ( ! $currency) {
$currency = wu_get_setting('currency_symbol');
$currency = wu_get_setting('currency_symbol', 'USD');
} switch ($currency) {
case 'AED':
$currency_symbol = 'د.إ';
@ -252,10 +252,10 @@ function wu_format_currency($value, $currency = null, $format = null, $thousands
$atts = wp_parse_args(
$args,
[
'currency' => wu_get_setting('currency_symbol'),
'format' => wu_get_setting('currency_position'),
'thousands_sep' => wu_get_setting('thousand_separator'),
'decimal_sep' => wu_get_setting('decimal_separator'),
'currency' => wu_get_setting('currency_symbol', 'USD'),
'format' => wu_get_setting('currency_position', '%s %v'),
'thousands_sep' => wu_get_setting('thousand_separator', ','),
'decimal_sep' => wu_get_setting('decimal_separator', '.'),
'precision' => (int) wu_get_setting('precision', 2),
]
);