• Resolved flowful

    (@flowful)


    View post on imgur.com

    I have issues translating the checkout page’s login form. I googled around and people offered Loco and Say What? plugins as an answer, but they didn’t help me, or I was using them wrong.

    Eventually, I found some answers from stack overflow with some code that worked. With the code, I was able to translate some text, “lost password”, and “Remember me” checkbox, but it doesn’t work for the “email” “password” and login-button anymore.

    How can I translate those words? Would it work if I changed the “$text” to something else?

    • This topic was modified 2 years ago by flowful.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter flowful

    (@flowful)

    I was able to make it work with same code after all. The Email and Password and Login were case sensitive, and it didn’t work when I typed them all with small letters..

    For people with same problems who find this, type this code into your child themes functions.php

    //Change the Create Account checkout text
    function wc_create_account_field_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
    case 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.' :
    $translated_text = __( 'Jos olet asioinut kanssamme aiemmin, kirjaudu sis??n t?st?. Jos olet uusi asiakas, siirry seuraavaan osioon.', 'woocommerce' );
    break;
    }
    return $translated_text;
    }
    add_filter( 'gettext', 'wc_create_account_field_strings', 20, 3 );
    
    function change_lost_your_password ($text) {
    
                 if ($text == 'Lost your password?'){
                     $text = 'Unohtuiko salasana?';
    
                 }
                        return $text;
                 }
        add_filter( 'gettext', 'change_lost_your_password' );
    
    function change_remember_me ($text) {
    
                 if ($text == 'Remember me'){
                     $text = 'Muista minut';
    
                 }
                        return $text;
                 }
        add_filter( 'gettext', 'change_remember_me' );
    
    function change_email ($text) {
    
                 if ($text == 'Email'){
                     $text = 'S?hk?posti';
    
                 }
                        return $text;
                 }
        add_filter( 'gettext', 'change_email' );
    
    function change_password ($text) {
    
                 if ($text == 'Password'){
                     $text = 'Salasana';
    
                 }
                        return $text;
                 }
        add_filter( 'gettext', 'change_password' );
    
    function change_login ($text) {
    
                 if ($text == 'Login'){
                     $text = 'Kirjaudu';
    
                 }
                        return $text;
                 }
        add_filter( 'gettext', 'change_login' );

    You might have to play around with Login button’s size through custom CSS maybe..?

    Kateryna K. a11n

    (@katinthehatsite)

    Hi there!

    Thanks so much for sharing the solution and I am glad you were able to find what worked for your site. I will mark this thread as closed on our end but if you run into any other questions, don’t hesitate to start a new conversation.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Translating issue with Checkout login form’ is closed to new replies.