0
votes

In my WPML->String Translation, I imported a .po file with all the translations I needed. I know at least a few of them are right, and "Translation is Complete" is checked.

As an example, I have a string that has the following :

Context : Careers

Name : Martial Artists

String : Martial Artists

French Translation : Pratiquants d'Arts Martiaux

Then I tried using the GetText function __() to have the string added to the return value of a shortcode :

return '<h5>' . __('Martial Artists', 'Careers') . '</h5>';

But on the page (mysite/fr/careers/), the English name Martial Artists still appears.

On the page, ICL_LANGUAGE_CODE equals "fr" so the page knows it's supposed to be in French.

Am I using the wrong function ? Are there arguments I don't understand, or steps I'm missing ? I've spent 2-3 hours on this and come up with nothing.

Thanks so much for your help !

1

1 Answers

0
votes

Where exactly do you have the translated files located?

Have you tried putting them in wp-content/languages/themes?

Use a prefix for the po/mo files, like ('Careers-fr_FR.po') and also set the content+prefix to 'Careers' in the advanced tab in the WPML config. Not sure about the capital though.