Skip Navigation

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

Problem:
If you're experiencing issues with WPML not displaying profile information correctly in the 'Member Directory' of the Ultimate Member plugin, the problem may stem from the way the plugin integrates JavaScript and PHP. Specifically, the issue arises in the members-grid.php file where the mix of JavaScript and PHP fails to match translated gender options (male, female, etc.) from the .mo file, leading to display issues.
Solution:
A temporary workaround involves manually scanning the plugin and translating 'Male' as 'Male' and 'Female' as 'Female' to bypass the matching issue. You can follow the steps outlined in this guide: Translate Strings by Yourself. Additionally, we recommend reporting this issue to the plugin developers since the integration was implemented by them and we have not been able to collaborate directly with them in the past.

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, 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 6 replies, has 2 voices.

Last updated by Bruno Kos 1 month, 2 weeks ago.

Assisted by: Bruno Kos.

Author Posts
September 30, 2024 at 5:23 am #16234067

goThrives

Background of the issue:
I'm using Ultimate Member form for register/profile. I've two fields: Language (multi-choice) and Gender (radio). WPML works well when showing the user profile information.

Symptoms:
WPML doesn't work when showing the profile info for 'Member Directory'.

Questions:
Why doesn't WPML work when showing the profile info for 'Member Directory'?

September 30, 2024 at 7:06 am #16234575

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

Hi,

Thank you for contacting WPML support!

Could you please replicate this on hidden link with the minimum amount of content necessary?

Please install the Ultimate Member plugin, and if anything else is needed, let me know.

I'll check in with our compatibility team. However, please note that Ultimate Member is currently not fully compatible with WPML, as mentioned here: https://wpml.org/plugin/?wpv_post_search=Ultimate%20Member. You may encounter issues, particularly with String Translation and other modules. We've attempted to collaborate with the plugin's author but haven't yet received the cooperation needed to resolve the compatibility issues.

Regards,
Bruno Kos

October 1, 2024 at 4:11 am #16238190

goThrives

Hi,

Thanks for the reply, I've replicated the issue with minimum content, please check the pages below:

1) Individual user profile hidden link
2) Members Directory: hidden link

As you can see, the fields of Gender and Language work on the English page but not on the German page

But they work well on the individual profile page in both languages.

Thank you for the help.

Best Regards

WMPL_UM2.jpg
October 1, 2024 at 7:34 am #16238704

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

This has been escalated to our Compatibility team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

October 3, 2024 at 4:53 am #16247849

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

We are currently unable to find a solution for this issue.

The problem lies in the way the author is calling the user profile within the file located at `.../wp-content/plugins/ultimate-member/templates/members-grid.php`, specifically in the following code:

<# if ( typeof user['<?php echo $key; ?>'] !== 'undefined' ) { #>
    <div class="um-member-tagline um-member-tagline-<?php echo esc_attr( $key ); ?>" data-key="<?php echo esc_attr( $key ); ?>">
        {{{user['<?php echo $key; ?>']}}}
    </div>
<# } #>

The issue stems from a mix of JavaScript and PHP in this section. The `JSuser` variable is pulling user information from the `wp_usermeta` table. However, when the gender options (male, female, etc.) are translated (as they are by default in the Ultimate Member .mo file), the matching fails, preventing the information from being displayed properly.

A temporary workaround would be to manually scan the plugin and translate "Male" as "Male" and "Female" as "Female" to bypass the issue. This can be done by following the instructions outlined in this guide: [Translate Strings by Yourself](https://wpml.org/documentation/getting-started-guide/string-translation/#translate-strings-by-yourself).

Since this integration was implemented by the author and we have not been able to collaborate directly with them in the past, can you report this issue to plugin developers?

October 4, 2024 at 3:13 am #16252287

goThrives

Hi,

Thanks for the response. I've followed the instructions but it doesn't work. Do you have any other suggestions or can you provide more detail about how to do it.

Thanks

October 4, 2024 at 11:12 am #16253788

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

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

If we translate these strings on hidden link, it shows but we can only have "male" and "female" on German as well: hidden link

Since this integration was implemented by the author and we have not been able to collaborate directly with them in the past, can you report this issue to plugin developers?

I'm afraid that apart form the above we don't have any other solutions.