Home Forums WoodMart support forum Translate ADD TO CART and Close

Translate ADD TO CART and Close

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #714380

    d_ch
    Participant

    Hi,

    Could you please help me translate the fields “ADD TO CART” and “Close” of Products grid shown at my attached screenshot?

    I use Loco Translate with custom relocate (languages/loco/themes/woodmart-el.po) for my translations and WoodMart Child Theme but I can’t find the specific strings.

    Thank you in advance,
    Dimitris

    Attachments:
    You must be logged in to view attached files.
    #714382

    d_ch
    Participant

    In the meantime I found a quick solution as below:

    add_filter('gettext', 'custom_translate_strings', 20, 3);
    function custom_translate_strings($translated_text, $text, $domain) {
    
        // WooCommerce
        if ($domain === 'woocommerce') {
            if ($text === 'Add to cart') {
                return 'Προσθήκη στο καλάθι';
            }
        }
    
        // WoodMart / Core
        if ($domain === 'woodmart' || $domain === 'xts-theme') {
            if ($text === 'Close') {
                return 'Κλείσιμο';
            }
        }
    
        return $translated_text;
    }
    • This reply was modified 3 months, 1 week ago by d_ch.
    #714416

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    There is no need to use the code snippet in the site.

    Please use the Loco translate plugin on your site. After installing the plugin please Navigate to Loco >> Themes >> Woodmart >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.

    Also, please Navigate to Loco >> Plugins >> Woocommerce >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.

    Also, please Navigate to Loco >> Plugins >> Woodmart-Core >> Edit the translation which you are using for the site >> Click the Sync button >> Find the words and add the translation for them and save it.

    https://wordpress.org/plugins/loco-translate/

    Note:
    1. Custom (recommended)
    2. This is Loco’s protected folder under “wp-content/languages/loco/” which is safe from automatic updates and provides priority over the above locations.
    https://localise.biz/wordpress/plugin/manual/msginit?utm_medium=plugin&utm_campaign=wp&utm_source=admin&utm_content=plugin-msginit#order
    If this folder doesn’t exist you may need to create it and ensure it has the correct permissions.
    https://localise.biz/wordpress/plugin/manual/filesystem

    If the issue still exists then please send me the WP admin login details of your site so I will check and solve the issue for you.

    For more information, please read the theme documentation here:
    https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    Also to update the theme translation in future after the theme update, please read and follow the instructions here:
    https://xtemos.com/docs-topic/theme-translation/

    Best Regards.

    #714501

    d_ch
    Participant

    Hello Aizaz,

    You can find at private content admin access.

    I still can’t find the following 5 strings:

    1) ‘Add to cart’
    2) ‘Close’
    3) ‘This wishlist is empty.’
    4) ‘Remove from wishlist’
    5) ‘Return to shop’

    I attach you relevant screenshots to check where are all the above.

    Waiting for your further advice,
    Dimitris

    Attachments:
    You must be logged in to view attached files.
    #714503

    d_ch
    Participant

    EXTRA screenshots attached

    • This reply was modified 3 months ago by d_ch.
    Attachments:
    You must be logged in to view attached files.
    #714511

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    Your issue has been solved. Please check the site now after removing the browser cache.

    Best Regards.

    #714515

    d_ch
    Participant

    Could you please inform me where did you find exactly the 5 strings described above?

    #714518

    Aizaz Imtiaz Awan
    Keymaster
    Xtemos team

    Hello,

    I have just followed the steps mentioned here in the theme documentation:https://xtemos.com/docs-topic/theme-translation/

    I have already shared this documentation URL in my first message.

    Best Regards.

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