Home Forums WoodMart support forum Small bug in translation of “Share” string in single product page

Small bug in translation of “Share” string in single product page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #427418

    roman
    Participant

    I’ve noticed that on localized product page, under meta fields (Sku, category), the string “Share” is still in English and not translated to the website language. The reason is that in the file /wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php there’s a function woodmart_product_share_buttons which contains following:

    array(
    	'type'          => $type,
    	'size'          => 'small',
    	'align'         => $align,
    	'show_label'    => 'yes',
    	'el_class'      => 'product-share wd-layout-inline',
    	'title_classes' => 'share-title',
    	'label_text'    => 'share' === $type ? esc_html__('Share:', 'woodmart') : esc_html__('Follow:', 'woodmart'),
    )

    The colon is inside the string “Share:” in the ‘label_text’ cell of the array and seems like cannot be translated because there should be just “Share”.
    The quick fix it to redeclare the same function in your functions.php and replace the string above to something like this:
    'label_text' => ( 'share' === $type ? esc_html__('Share', 'woodmart') : esc_html__('Follow', 'woodmart') ) . ':',

    • This topic was modified 3 years, 6 months ago by roman.
    #427420

    Artem Temos
    Keymaster
    Xtemos team

    Hello,

    You should be able to translate this word also as a separate entity. Check this screenshot https://gyazo.com/f811cdb5c666e69eb1e1afb57359a940

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)