K
K
kursof12019-02-19 13:48:21
WordPress
kursof1, 2019-02-19 13:48:21

How can I bind the currency function in multiple languages?

I use polyleng and wookomers. And there was a need to make several currency transfers? I am using this script.

function add_my_currency( $currencies ) {
$currencies['UAH'] = __( 'Українська гривня', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);

function add_my_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'UAH': $currency_symbol = ' грн.'; break;
ВАЛЮТА'; break;
}
return $currency_symbol;
}

But how can I make it so that on the Russian version, for example, I would display not the hryvnia, but the hryvnia, also in the English gryvna? polylang has a function pll_register_string('valyta1', 'valyta2', 'valyta3'); But will she work?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question