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: Not WPML issue
This topic contains 11 replies, has 2 voices.
Last updated by Waqar Ali 1 year, 6 months ago.
Assisted by: Waqar Ali.
Author | Posts |
---|---|
December 5, 2023 at 1:40 pm #14998353 | |
arthurE |
I'm trying to use string translation on a dual language website. The main language is Portuguese and the secondary language is Spanish. I'm using the Ultimate member plugin, it's in English, and I'm using string translation to translate the plugin's messages into Portuguese and Spanish. In Portuguese (the site's default language) it works correctly, but in Spanish it doesn't work well. I need help and can provide a development environment with wp-admin access if necessary. |
December 6, 2023 at 10:09 am #15006019 | |
Waqar Ali |
Hi, Thank you for contacting us and I'd be happy to assist. To troubleshoot this, I'll need to see how the Ultimate member plugin and the WPML are configured in the admin area. Can you please share the temporary admin login details for the development/staging website along with the exact steps to see the string translations that are not working? Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details. regards, |
December 7, 2023 at 2:34 pm #15017667 | |
Waqar Ali |
Thank you for sharing the access details. I've performed some testing and research and found this relevant thread with the code to make this translation work: Please follow those steps and let me know how it goes. Since the 'Ultimate Member' is not in our compatible plugins list, I'll also encourage you to get in touch with the plugin author and ask them to join our go-global program ( ref: https://wpml.org/documentation/support/go-global-program/ ). |
December 8, 2023 at 12:48 pm #15025625 | |
arthurE |
Thanks for your response. But this solution from the other topic didn't work for me. I added the code to functions.php but the strings did not appear in "String translation". See the attached images. Just out of curiosity, I searched for the "ihc_public_subscription_plan_list_levels" filter in the Ultimate Member and WPML source code and didn't find it. Maybe that's why the solution code didn't work. Would you have any other suggestions? |
December 13, 2023 at 8:45 am #15051763 | |
Waqar Ali |
Thank you for waiting, as I had a busy forum queue over the weekend. The plugin updates must be responsible for the change in this filter name. Do I have your permission to download a clone/snapshot of the website? This will allow us to investigate this deeper, without affecting your actual website. |
December 13, 2023 at 2:08 pm #15055557 | |
arthurE |
Hello, thanks for the answer, and yes, you can download a copy of the website, as long as the data is deleted after support is complete. |
December 18, 2023 at 6:42 am #15080499 | |
Waqar Ali |
I've downloaded the website's clone and it will be deleted, once the this troubleshooting has concluded. I'm currently performing some tests on this and will share the findings, as soon as this testing completes. Thank you for your patience. |
December 28, 2023 at 1:50 pm #15134975 | |
arthurE |
Hello! Any progress? |
December 29, 2023 at 12:09 pm #15136623 | |
Waqar Ali |
Just wanted to let you know that I'm still working on this and will share further findings, within the next few hours. Thank you for your patience. |
January 2, 2024 at 6:02 pm #15144425 | |
arthurE |
Hi! Great! Do you have news to share? |
January 3, 2024 at 1:30 pm #15146826 | |
Waqar Ali |
Thank you for checking in and a Happy New Year. Unfortunately, couple of filters that I've tested weren't successful. But, I'm working on an alternative approach. Will get back to you as soon as it's working. |
January 8, 2024 at 2:42 pm #15160970 | |
Waqar Ali |
Thank you for waiting. Further testing revealed that for the field label's the string translation does translated them correctly. However, the way 'Ultimate Member' loads its fields in the final output, it again uses the default labels for the primary language. I was able to use 'Ultimate Member' plugin's own filter 'um_predefined_fields_hook' to translate the labels which were not showing correctly. For example, for the case of 'Profile Privacy' field, I used the custom code: add_filter( 'um_predefined_fields_hook', 'my_predefined_fields', 10, 1 ); function my_predefined_fields( $predefined_fields ) { // get current language $my_current_lang = apply_filters( 'wpml_current_language', NULL ); // if the field label is 'Profile Privacy' if($predefined_fields['profile_privacy']['label'] == 'Profile Privacy') { // for 'Portuguese' if($my_current_lang == 'pt-br') { $predefined_fields['profile_privacy']['label'] = 'Profile Privacy in Portuguese'; } // for 'Spanish' if($my_current_lang == 'es') { $predefined_fields['profile_privacy']['label'] = 'Profile Privacy in Spanish'; } } // case of field label 'Profile Privacy' ends here return $predefined_fields; } You can replace 'Profile Privacy in Portuguese' and 'Profile Privacy in Spanish' with your own translated strings, as needed. You'll find the actual labels used by the plugin in it's file, within the function named 'set_predefined_fields': Similarly, you can add translation blocks for other fields too, in the same custom function. |