Translate YOUR ITEMS - WOOCOMMERCE

Hi there,

I’m wondering what is a good way to translate the CART / YOUR ITEMS string?

I tried following this: https://theme.co/docs/theme-translations

And since that did not work. I tried the alternative solution posted at the bottom:

function custom_text_translate($translated) {
$translated = str_ireplace(‘Your Items’, ‘Termékeid’, $translated); return $translated;
}
add_filter(‘gettext’, ‘custom_text_translate’ );

But this did not work either.

Hi @Pbalazs89,

Please try this:

// Translate Strings
add_filter( 'gettext', 'translate_x_strings', 20, 3 );

function translate_x_strings( $translated_text, $text, $domain ) {

        switch ( $translated_text ) {

            case 'Your Items' :

                $translated_text = __( 'Termékeid', '__x__' );
                break;

        }

    return $translated_text;
}

Kindly note that since this is a custom code that changes the default behavior/display of the theme, you will be responsible to maintain or update the code in case you require further changes or if the code stops working in future updates. If you are uncertain how to proceed, it would be best to get in touch with a developer.

Hope this helps.

Hi there,

Added the code, unfortunately it did not work:

Hello @Pbalazs89,

Have you tried just changing the text in the Cart settings?

If you are not seeing this option, please click on the cog icon on the settings area then enable the Advanced Mode option.

Hope this helps.

Well, sorry for taking your time. I did not know that was there as an option. :slight_smile:

No worries at all, @Pbalazs89. The option is quite easy to miss. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.