This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:
Using strings directly in php file, how to translate these strings?

Solution:
To translate these strings, you must use some gettext function, such as "_e()" or "__()". For example:

<?php _e( "Created and managed by" ); ?>

Relevant Documentation:
https://codex.wordpress.org/L10n
https://codex.wordpress.org/Function_Reference/_e

This topic contains 4 replies, has 2 voices.

Last updated by gentianG 2 years, 3 months ago.

Assigned support staff: Bruno.

Author Posts
March 29, 2017 at 8:36 am #1242061

gentianG

Dear Support,

I have been trying to translate several strings on dardan.al.
Attached you will find a screenshot (dardan-screenshot-string-translation.png) in order to create a better idea.
As you can notice from the screenshot strings are mixed up with both languages. Albanian and English. And this is not the only concern.
As we try to translate those strings into corresponding language, we have noticed that in English no changes are made, strings are not updated, it is same content as it is in Albanian version.

What would you suggest us as solution?

Kind Regards,

March 29, 2017 at 6:24 pm #1242691

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us.

I noticed that on the form you are using Contact Form 7.

To translate Contact Form 7, you must follow the steps in our documentation: https://wpml.org/documentation/plugins-compatibility/using-contact-form-7-with-wpml/

Also, as you are adding this form within the Widget, you can use WPML Widgets to add shortcodes in other languages. You can see our documentation here: https://wpml.org/2014/08/display-different-widgets-per-language-wpml-widgets/

On the other strings, are these strings being displayed inside the WPML > String Translation? If yes, are the strings selected as "Translation is complete"? I'll attach an image as an example.

Thank you.

April 4, 2017 at 9:12 am #1246593

gentianG

Hello again,

Thank you for your support. We have followed your instructions and
1. Contact Form---> Done
2. Widgets --->Done
3. Footer copyright---Still Need Assistance

We have tried to translate strings of footer.php, did a theme scan serveral times and we still are not able to find those strings(from scan "Created and managed by" strings are not generated). For a specific reason, strings are not found.

What would you suggest?

Thank you in advance,

April 4, 2017 at 2:01 pm #1246936

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

This may be how the footer is being created. Where do you edit the footer content? Is this just in the footer.php file? Or do you edit this content within an option of your theme?

For the string to be translatable, the string must be using gettext functions. For example:

<?php _e( "Created and managed by" ); ?>

Is the string in this format? If not, please could you try to verify that the string is displayed in String Translation?

If the problem persists, I need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

*** Note: Please make a full backup of your site.

Privacy and Security when Providing Debug Information for Support: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Thank you.

May 22, 2017 at 9:27 am #1281350

gentianG

Thank you for your support.