This thread is resolved. Here is a description of the problem and solution.
Problem:
The client reported an issue where taxonomy terms such as 'Year' were not translating correctly on their vehicle listing page, despite having translations available. The default site language had been switched from English to Dutch, which seemed to affect the translation functionality.
Solution:
We identified that the issue was related to how the theme handled translations within specific PHP templates. To resolve this, we provided a code snippet to modify the theme's PHP file to ensure proper translation registration and application using WPML's hooks:
<?php<br />// WPML Workaround for compsupp-7432<br />if (class_exists('Sitepress')) {<br /> $textdomain = 'motors';<br /> $string_name = 'Motors - WPML String: '.substr($single_name, 0, 20);<br /><br /> if (apply_filters('wpml_default_language', NULL) == apply_filters('wpml_current_language', NULL)) {<br /> do_action('wpml_register_single_string', $textdomain, $string_name, $single_name);<br /> }<br /> // Apply the translation to the string<br /> $single_name = apply_filters('wpml_translate_single_string', $single_name, $textdomain, $string_name);<br />}<br /></code><br /><td class="t-label"> <?php echo esc_html($single_name); ?></td><br />After applying this change, the client was instructed to visit the page in the original language to register the string and then translate it via WPML > String Translator under the 'motors' textdomain.<br /><br />If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend opening a new support ticket. Additionally, please check related known issues at <a href="https://wpml.org/known-issues/">https://wpml.org/known-issues/</a>, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. For further assistance, you can also visit our support forum at <a href="https://wpml.org/forums/forum/english-support/">https://wpml.org/forums/forum/english-support/</a>.</td>
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 26 replies, has 3 voices.
Last updated by Carlos Rojas 3 months, 1 week ago.
Assisted by: Carlos Rojas.