D
D
dm2015-11-08 20:08:05
Machine translation from one language to another
dm, 2015-11-08 20:08:05

woocommerce. How to change a phrase?

How to replace one Russian word with another? I want to change "Subtotal" to "Sum", but I don't understand how. Woocommerce has a woocommerce.pot file, you can't translate all phrases because of one.
I tried Saphali Woocommerce Russian, but I didn't understand how to change this phrase either.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex, 2015-11-08
@Chekhoved

There is a plugin for editing translation files https://ru.wordpress.org/plugins/loco-translate/

I
Ivan Malyshev, 2019-07-21
@yos

in functions.php add the following:

add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
 
function translate_text($translated) {
$translated = str_ireplace('Подытог', 'Сумма', $translated);
return $translated;
}

Accordingly, instead of " Amount " you can insert your own word

A
Aleks9990, 2021-10-19
@Aleks9990

add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Subtotal', 'Sum', $translated);
return $translated;
}
Nice to the author, but if you still need to change other fields, can you tell me the scheme so that you don’t write for each line?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question