Skip Navigation

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

Problem:
The client is unable to translate strings such as "More info" or "Read more" that are located in Twig files, even after scanning the theme and plugins in WPML.
Solution:
We recommend generating a .po/pot file as outlined in the documentation, which can then be used with WPML's String Translation to scan and translate the strings in your theme or plugin. Here is the documentation link: Timber Documentation for Internationalization.

Additionally, you may find this GitHub thread useful: GitHub Timber Issue #468.

If this solution doesn't look relevant, please open a new support ticket.

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.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Lucas Vidal de Andrade 1 year, 6 months ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
November 22, 2023 at 10:31 am #14895667

michielK-4

I am trying to translate some generic strings like "More info" or "Read more". These strings are wrapped in the correct translation functions provided by Timber/Twig (e.g. __()) and should therefore be translatable. However, after scanning the theme and plugins in WPML these strings are not found in the string translation view.

Is there another way to translate strings located in Twig files?

November 24, 2023 at 1:49 pm #14917931

Lucas Vidal de Andrade
WPML Supporter since 11/2023

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for reaching out to WPML support! I'm here to assist you with your inquiry.

The String Translation feature is capable of scanning strings within files with .php and .inc extensions. However, if you happen to be using files with the .twig extension, I would suggest referring to the documentation provided below. It outlines the steps to generate the .po/pot file, which can then be employed with String Translation to scan and translate the strings in your theme or plugin. Documentation Link: hidden link

I also recommend you take a look on this thread. It might help you as well:
hidden link

I'm awaiting your response.

Warm regards.