skip to Main Content

I’m using woodmart theme, woocommerce and i can’t find a way to translate these two elements "Wishlist" and "Logout" without using plugins
Usually when we change the website’s language woocomerce does as well, well actually it did, but these two are still the same.
Now i’m just trying to find where their Html is and just change it but i couldn’t find itScreenShot

i inspected the elements, copied their classes, used vsCode to search for those classes but no results were found except for this class " woocommerce-MyAccount-navigation-link " but it only found css

2

Answers


  1. Chosen as BEST ANSWER

    Here is how i fixed the problem Using 'gettext' :

    add_filter( 'gettext', 'rename_logout_wishlist_text', 10, 3 );
    function rename_logout_wishlist_text( $translated_text, $text, $domain ) {
        if ( $text === 'Logout' ) {
            $translated_text = 'Déconnexion';
        }
    
        if ( $text === 'Wishlist' ) {
            $translated_text = 'Liste de souhaits';
        }
    
        return $translated_text;
    }


  2. Add the following lines to your functions.php

    add_filter( 'woocommerce_account_menu_items', 'rename_logout' );
    function rename_logout( $menu_links ){
        
        $menu_links[ 'customer-logout' ] = 'Get out here!';
    
        return $menu_links;
    }
    

    This will change "Logout" to "Get out here!"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search