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?