Topic Resolution: Resolved
  • Closed
  • June 29, 2015 at 11:20 am #18566

    Hi!

    I have my homepage in Swedish and wordpress is set to Swedish. Woocommerce is also set to Swedish.
    Still there is a problem when I active Evolves settings when you want to show the cart in header. Can’t get it to change to Swedish instead of the English “Item(s)”. The theme Evolve plus doesn’t have the word “item” in it’s .po file.

    Can someone pls give my a clue how to fix this?
    Have search the forum for this problem without success.

    Imran
    Spectator
    Posts: 402
    June 29, 2015 at 12:05 pm #18567

    Hi there,

    Thanks for writing in, would you mind providing your website URL so we take a closer look into your setup and provide you with a tailored response.

    Thanks.

    Patrik Löfvander
    Spectator
    Posts: 11
    June 29, 2015 at 1:09 pm #18570

    http://www.mediakusten.se

    The shop is not visuable since I’m preparing to sell my book in about a month.
    I will activate the cart. Thanks!

    Imran
    Spectator
    Posts: 402
    June 29, 2015 at 2:22 pm #18571

    Hi there,

    The translation string for item(s) is located under file /wp-content/evolve-plus/languages/en_EN.po in your website installation. Are you using any 3rd party plugin to translate your website?

    Thanks.

    Patrik Löfvander
    Spectator
    Posts: 11
    June 30, 2015 at 5:56 am #18585

    Ok I have opened the swedish translation to continue with the translate and try to put in item(s) with poedit.
    So I have to start from the beginning and translate the English file to a new Swedish?

    Is there no way to just put in new words in poedit? Sorry for my questions. I’m new with translation files.

    Thanks!

    Imran
    Spectator
    Posts: 402
    June 30, 2015 at 11:47 am #18589

    Hi Patric,

    I’m assuming that you have a child theme installed in your website. So you can simply add the following code in your child theme’s functions.php file and if your functions.php file is blank, add following line before the provided code <?php:

    // =============================================================================
    // Translate string using 'gettext' filter
    // =============================================================================

    add_filter('gettext', 'custom_strings_translation', 20, 3);

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

    switch ( $translated_text ) {
    case 'Item(s)' :
    $translated_text = __( 'REPLACE_THIS_WITH_TRANSLATION', 'evolve' );
    break;
    }

    return $translated_text;
    }

    REPLACE_THIS_WITH_TRANSLATION Replace this line with the translation you want.

    Thanks.

    Patrik Löfvander
    Spectator
    Posts: 11
    June 30, 2015 at 12:48 pm #18590

    Hi Imran!

    Thanks mate!

    Will try that!

    //Patrik

    Patrik Löfvander
    Spectator
    Posts: 11
    July 1, 2015 at 7:26 pm #18602

    Hi again!

    Ok tried the code above but didn’t get it to work properly.
    I’m using the evolve premium so I tried evolve-plus but must be doing something wrong.

    Anyone, the Swedish translation doesn’t have the “Item” and your cart is empty and some more Word is missing as well.
    The sv_SE.po file is missing those words so I need to update the po file so I can translate the missing words. I really don’t like to translate the whole en_EN which has the missing words.

    To continue the Swedish translation I need the .pot file if I’m not mistaken so I can update the sv_SE.po file with the missing words. Is that correct? I can’t find any pot files in my theme evolve-plus!

    Is there no .pot file to update from?

    Denzel Chia
    Moderator
    Posts: 2656
    July 2, 2015 at 3:01 am #18604

    Hi,

    Please use this plugin https://wordpress.org/plugins/loco-translate/

    After installation go to WordPress Admin -> Loco Translate -> Manage Translations.
    Click on your language, I believe it’s sv_SE.po, you will be redirect to it’s translation page.
    Click on sync button, you will see that missing strings are updated.
    Then Click on save and it will generate the updated sv_SE.po and sv_SE.mo files.

    Use the “Filter Translations” search input, to search for the string that you want to translate.
    Do your translations.
    Remember to click save button after each translation!

    Screenshot. http://prntscr.com/7nsk61

    Hope this helps!

    Thanks!
    Denzel

    Patrik Löfvander
    Spectator
    Posts: 11
    July 2, 2015 at 7:57 am #18609

    Thanks Denzel!

    It really works!

    Thanks again!

    //Patrik

    Denzel Chia
    Moderator
    Posts: 2656
    July 2, 2015 at 3:33 pm #18614

    Hi Patrik,

    You are welcome.

    Thanks!
    Denzel