• jurijsmsk

    (@jurijsmsk)


    Hello, having problem with finding way to translate “BRAND:” text at woo product pages. Meta php doesn’t contain anything, PHP snippet didn’t work. Looking for solution without plugins…

    img – https://ibb.co/wFT506Wc

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I understand your concern. You can try using the following code to translate the “Brand” text.

    // Change button text
    function ts_change_proceed_to_checkout_text($translated_text, $text, $domain) {
    if ($text === "Brand") {
    $translated_text = 'add new text here'; // Change to your desired text
    }
    return $translated_text;
    }
    add_filter('gettext', 'ts_change_proceed_to_checkout_text', 20, 3);

    If that does not help, could you please provide more details on the exact translation settings you have configured on your site? This will allow me to replicate the issue on my end and guide you accordingly.

    Also, here is a complete guide on how to translate WooCommerce:
    https://woocommerce.com/document/woocommerce-localization/

    Please note that generally we do not provide support for customization, If you want to consider professional assistance for customization, I can recommend?WooExperts?and?Codeable.io?as options for getting professional help. Alternatively, you can also ask your development questions in the??WooCommerce Community Slack?as custom code falls outside our usual?scope of support.

    Thank you

    Thread Starter jurijsmsk

    (@jurijsmsk)

    Thanks. Last but not least breadcrumbs. It works, but adds extra “s” letter at the end of translated text.

    add_filter('rank_math/frontend/breadcrumb/items', 'translate_brand_in_breadcrumbs', 10, 2);
    function translate_brand_in_breadcrumbs($crumbs, $class) {
    foreach ($crumbs as $key => $crumb) {
    if (isset($crumb[0]) && strpos($crumb[0], 'Brand') !== false) {
    $crumbs[$key][0] = str_replace('Brand', 'Ra?otājs', $crumb[0]);
    }
    }
    return $crumbs;
    }
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there,

    I’m glad to hear the translation is working! Regarding the extra “s” at the end of the translated text, it might be caused by an unintended string modification or an existing setting in Rank Math.

    I would suggest reaching out to Rank Math support to see if they can assist in resolving this issue. As mentioned earlier, customization falls outside our scope of support.

    If Rank Math support is unable to provide a solution, you may consider hiring a developer to help with this customization. Services like WooExperts?and?Codeable.io can connect you with experienced developers.

    Alternatively, you can also ask your development questions in the??WooCommerce Community Slack?as custom code falls outside our usual?scope of support.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.