Skip Navigation

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

Problem:
I am using the Theme and plugins localization screen to scan for strings to translate, but it does not pick up strings in .twig templates, for example:

{{ __('Example heading to translate', 'example-domain') }}

How can we translate the strings in all the .twig files in the theme, ideally from the String translation screen?
Solution:
Can you please try to go to WPML -> String Translation and enable the option: Look for strings while pages are rendered.

Then try to access the site somewhere that text is available and go back to the String Translation screen to see if those texts will be available for translation now.

Don't forget to uncheck that option once you're done.
Relevant Documentation:
https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/

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 3 replies, has 2 voices.

Last updated by danM-2 1 year, 9 months ago.

Assisted by: Mateus Getulio.

Author Posts
July 5, 2023 at 12:50 pm #13950743

danM-2

I am using the Theme and plugins localization screen to scan for strings to translate, but it does not pick up strings in .twig templates, for example:

<h2>{{ __('Example heading to translate', 'example-domain') }}</h2>

How can we translate the strings in all the .twig files in the theme, ideally from the String translation screen?

I can see that this question has been asked before, but the solution is hidden:

https://wpml.org/forums/topic/how-do-i-import-strings-from-another-website/

July 5, 2023 at 7:44 pm #13953769

danM-2

Hi,

Can I speak to someone about this soon please as we have a site launching in a couple of days and we are unable to translate most of the theme strings!

Dan.

July 5, 2023 at 7:52 pm #13953801

Mateus Getulio
Supporter

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

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

Hey there,

Can you please try to go to WPML -> String Translation and enable the option: Look for strings while pages are rendered.

Then try to access the site somewhere that text is available and go back to the String Translation screen to see if those texts will be available for translation now.

Don't forget to uncheck that option once you're done.

Thank you, please let us know how that goes.