Support » Plugin: GEO my WordPress » Translate into french

  • Resolved arbremojo

    (@arbremojo)


    Hi,

    Where should I put the PO/MO files to make the translation work in frontend? Cause right now, only some word or sentences are translated, but many are not (such as “Get directions”…). I tried adding them to wp-content/languages/plugin/geo-my-wp/languages and also wp-content/languages/plugin, but none of them worked.

    Regards,

    Clara.

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter arbremojo

    (@arbremojo)

    Up!

    @arbremojo
    Are you using Loco translate plugin?
    My custom French translations live in:
    wp-content/languages/loco/plugins/
    geo-my-wp-fr_FR.mo
    wp-content/languages/loco/plugins/geo-my-wp-fr_FR.po

    Note: Don’t forget to use the Synk button to fetch all the latest strings.

    • This reply was modified 6 months, 1 week ago by Anticosti.
    Thread Starter arbremojo

    (@arbremojo)

    I’m not using Loco. Should I?

    Yes. You should to customize and even translate some missing translations.

    Thread Starter arbremojo

    (@arbremojo)

    But I’m already using Poedit to customize my strings…

    Plugin Author Eyal Fitoussi

    (@ninjew)

    Hello @arbremojo,

    If not using the Loco Translate plugin, you should name your PO/MO file geo-my-wp-fr_FR.mo and place them in wp-content/languages/plugins/.

    I just tested it on my site and I can confirm that it is working for both the front and back-end of the site.

    Thread Starter arbremojo

    (@arbremojo)

    Hi @ninjew,

    That’s what I did, I took the french PO/MO files which were in wp-content/plugins/geo-my-wp/languages and put it into wp-content/languages/plugins, but my website is still not translated. Please check this page:

    https://www.bricolage.fr/magasins-de-bricolage/?address%5B0%5D=18+Rue+du+P%C3%A8re+Maunoir%2C+35000+Rennes%2C+France&post%5B0%5D=magasins&distance=200&units=metric&per_page=5&lat=48.100139&lng=-1.664459&form=1&action=fs

    You can see that there are english words and sentences like “phone, email, website, get directions…” although these words have already been translated.

    Plugin Author Eyal Fitoussi

    (@ninjew)

    @arbremojo,

    I took the french PO/MO files which were in wp-content/plugins/geo-my-wp/languages and put it into wp-content/languages/plugins, but my website is still not translated.

    Have you renamed the PO/MO files as I mentioned above ( geo-my-wp-fr_FR.mo ) after moving them from the plugin’s folder?

    Thread Starter arbremojo

    (@arbremojo)

    They already were renamed like this (geo-my-wp-fr_FR.mo) in the plugin, so I didn’t need to rename them. However it doesn’t work…

    Plugin Author Eyal Fitoussi

    (@ninjew)

    @arbremojo,

    They already were renamed like this (geo-my-wp-fr_FR.mo) in the plugin

    Of course they were, silly me. Working too late at night.

    Are any of your strings translated at all and the issue is with the strings you mentioned above only? Or the translation file isn’t working at all?

    Thread Starter arbremojo

    (@arbremojo)

    Plugin Author Eyal Fitoussi

    (@ninjew)

    @arbremojo,

    Thank you for clarifying.

    I went over the replies above again and I now realize that the issue is not with the translation file. The file loads fine.

    The problem is that the labels of the contact info ( phone, fax… ) are being called dynamically from the location meta database table into the results template file. Because of that, they cannot be translated via a translation file. The labels that you did find in the translation file are being used elsewhere in the plugin where they are not being loaded dynamically.

    To translate the labels in the search results you will need to use the custom function below. Just add the functions to the functions.php file of your theme and change the labels ( “phone label”, “fax label”… ) as you wish:

    
    function gmw_custom_translate_contact_labels( $labels ) {
    
    	return array(
    		'phone'   => 'Phone Label',
    		'fax'     => 'Fax Label',
    		'email'   => 'Email Label',
    		'website' => 'Website Label',
    	);
    }
    add_filter( 'gmw_get_location_meta_list_labels', 'gmw_custom_translate_contact_labels', 50 );
    

    Regarding the “Get Directions” label. I just tested it with a translation file and it works fine. Note that there are 2 “get directions” strings in the PO file, so
    please make sure to translate both and check again if it is working.

    let me know how it goes.

    Thread Starter arbremojo

    (@arbremojo)

    Thanks a lot @ninjew !!! It works great! Indeed, some of the strings were translated but there were several of them were not. And your function works perfectly!

    Plugin Author Eyal Fitoussi

    (@ninjew)

    You are very welcome, @arbremojo. I am glad I could help.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Translate into french’ is closed to new replies.