Translate word; "Related product" on product page

Hello,

Any ideea how i can translate the "Related product" on the product page ?

Now it's writing "Produse Similare" But i realy don't find where i can cgange it.

Comments

  • Hello,
    This is original string from the WooCommerce, we didn't have option to change that string in the Betheme. Remember, that WooCommerce is taking the language to that string from primary language of the website.
    To change that string for static value, you have to edit the plugin's files.
    Thanks
  • Hello,

    OK, i solve this problem, I have add this code on function.php file and it's work:

    // 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__('ALTE INSTALATII GPL', $domain);
         }
         return $translated;
    }
Sign In or Register to comment.