Skip Navigation

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 Dražen 4 months, 2 weeks ago.

Author Posts
August 29, 2024 at 12:57 pm #16120041

davidR-107

Background of the issue:
We are seeing a couple of UI elements of the The Events Calendar plugin rendered in English when we are browsing the related pages in German. The UI elements are translated using standard WordPress l10n functions and dumping the WPML language shortly before, renders the correct language code 'de' while the string itself remains untranslated.

echo apply_filters( 'wpml_current_language', null ); ?>
_e( 'Enter Keyword. Search for %s by Keyword.', 'the-events-calendar' );

The strings appear in the string translation table in the settings and are translated in the given domain for all languages. The default language of the page is German, the original language of the strings in question is English. Checking 'Look for strings while pages are rendered' on the String Translation settings page will temporarily render the correct translation. Disabling it will also render the strings untranslated again. The ../wp-content/languages/wpml/ directory exists and is writable. Based on reports and personal testing the behaviour has been inconsistent across various page loads with the translations working correctly on rare occasions. Link to a page where the issue can be seen: hidden link

Symptoms:
The translation strings of the given domain are not translated consistently. The strings are only translated if 'Look for strings while pages are rendered' is checked.

Questions:
Why are the UI elements of The Events Calendar plugin not consistently translated to German?
Why does checking 'Look for strings while pages are rendered' temporarily fix the translation issue?
What could cause the inconsistent behavior of translations across various page loads?
Is there a permanent solution to ensure the strings are always translated correctly?

August 29, 2024 at 1:17 pm #16120209

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

Thanks for contacting us.

While you wait for my colleague to take over the ticket, let me try to help you with the issue quickly.

Can you please try the next errata and check if this helps your case also:

https://wpml.org/errata/the-events-calendar-translation-issues-for-certain-strings-with-non-block-themes/

Regards,
Drazen

August 29, 2024 at 2:08 pm #16120517

davidR-107

Hello,

Thanks for the quick response.

The linked errata didn't come up in any of the searches we did but does indeed solve the issues we saw previously.