add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('Related Products', 'Сопутствующие товары', $translated);
return $translated;
}
// Change WooCommerce "Related products" text
add_filter('gettext', 'change_rp_text', 10, 3);
add_filter('ngettext', 'change_rp_text', 10, 3);
function change_rp_text($translated, $text, $domain)
{
if ($text === 'Related products' && $domain === 'woocommerce') {
$translated = esc_html__('Check out our other products', $domain);
}
return $translated;
}
add_filter('gettext', 'dco_gettext', 20, 3);
function dco_gettext($translated_text, $text, $domain) {
switch ($translated_text) {
case 'Related Products' :
$translated_text = 'сопутствующие продукты';
break;
}
return $translated_text;
}
add_filter('gettext', 'dco_gettext', 20, 3);
function dco_gettext($translated_text, $text, $domain) {
switch ($text) {
case 'Related Products' :
$translated_text = 'сопутствующие продукты';
break;
}
return $translated_text;
}