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 topic contains 1 reply, has 2 voices.

Last updated by Cristina 2 years, 3 months ago.

Assigned support staff: Cristina.

Author Posts
March 12, 2018 at 11:22 pm #1544180

yevgenR

Is there any documentation that you are following?
https://wpml.org/faq/getting-string-translation-to-work/

What is the link to your site?
hidden link

Hello, please, help me with item,

In the function.php in the child theme, there are two links that were used to translate by GetText method for hard-coded strings(screenshot wpml3).

After that, they appeared in the translation string and were translated from English into Russian and Ukrainian (screenshot wpml2).

And everything worked fine, but recently, for some reason unknown to me, it stopped working, and now these English words are displayed on all variants of the site (screenshot wpml1).

Please, help me.

March 14, 2018 at 9:48 pm #1546334

Cristina

Hello Yevgen,

thanks for contacting and sorry for the delays.

There may have changed something in the page that does not match this string anymore to the translation.

Did you update the parent theme recently?
If yes, this there could be some change that affected this string.

Maybe the strings have been changed or added by the parent theme, if the theme updated, and the original language for it changed too.

Please try if changing the method for the translated string helps in any way:

<?php __('give feedback', 'theme-text-domain'); ?>
and
<?php esc_html_e( 'give feedback', 'theme-text-domain' ); ?>

Try also changing the text-domain to a unique text-domain for your child theme.

Does this work if you add this to the parent theme?

If you are still using an older WPML version, please check go to the page WPML -> Theme and plugin localization and uncheck the option "Assume all strings are in english" if that was active.

If that does not help I would need some more information about this to be able to see the problem.

I am enabling the debug information box for your next reply. To get some more information about your problem, please fill in the debug information for your next answer. You will find the debug info in WPML > Support > debug information. Just copy the text in the grey area and paste it into the field. This way I can see more about the settings and the site structure.

Kind regards,
Cristina

The topic ‘[Closed] Using GetText for hard-coded strings has stopped working on the site’ is closed to new replies.