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 Raja Mohammed 1 month, 1 week ago.

Assigned support staff: Raja Mohammed.

Author Posts
September 5, 2019 at 4:24 am #4515315

shaolinL

I'm using UPME (User Profiles Made Easy) plugin for membership site. The plugin uses a "View Profile" page to display profiles of users.

All newly registered users get an ID. So user's profile links are like this: /profile/1, /profile/7, profile/100 etc.

When I switch to another language, it shows /profile?lang=es, etc.
But it should be, as I set it, /profile/1?lang=es, /profile/1?lang=cn, etc.

You can check the live site here: hidden link
After you are on the page, click the spanish icon to switch to Spanish language. Then you will see the error.

Please help.

September 6, 2019 at 4:34 am #4523299

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The issue has been escalated to compatibility team, I will let you soon once I have an update from the compatibility team.

September 6, 2019 at 3:00 pm #4526149

shaolinL

Hello,

Should I wait for your update or do you need any info from me to resolve the issue please?

Regards
Leon

September 9, 2019 at 2:31 am #4532891

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I think I have required information, I will let you know once I have an update on this issue.

September 11, 2019 at 4:32 am #4550561

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I have a quick workaround to help you better. Add the below code to your theme functions.php file

add_filter( 'icl_ls_languages', function( $languages ) {
	global $upme;

	if ( get_query_var('page_id') == get_option( 'upme_profile_page' ) ) {
		$current = apply_filters( 'wpml_current_language', false );
		$user_id = upme_get_user_id_by_profile_url( $_SERVER['REQUEST_URI'] );
		foreach ( $languages as $code => $language ) {
			do_action( 'wpml_switch_language', $code );
			$languages[ $code ]['url'] = $upme->profile_link( $user_id );
		}
		do_action( 'wpml_switch_language', $current );
	}
	return $languages;
} );

The workaround is a temporary fix and works only with directory language setup. To make the plugin completely compatible with WPML the plugin author can contact us directory through our go global program https://wpml.org/documentation/theme-compatibility/go-global-program/

I hope this helps you better

Kind regards
Raja

September 11, 2019 at 3:13 pm #4554663

shaolinL

Hello,

Thank you and I will try this code and see if it works for me.

What do you mean by directory language setup please?

It seems that I searched and found that the plugin author was on your go global problem, but I'm not sure if it's true or not.

Best regards
Leon

September 12, 2019 at 5:00 am #4558359

Raja Mohammed
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Directory language is the current URL setup for language you have enabled for your site.

If the plugin is already on the Go Global program you can notify the plugin author about the compatibility issues and ask them to contact us directly as they did earlier. Our team will further initiate the process.

Kind regards
Raja