Skip Navigation

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

Problem:
The client needed to translate the slug of a user role generated by their theme, but WPML does not support the translation of user role slugs.
Solution:
We explained that WPML cannot translate user role slugs directly. However, we suggested that if the roles are presented using Custom Post Types (CPTs), they could be translated using WPML's standard translation features for CPTs. We provided documentation links for translating user meta information and CPTs:

If this solution does not seem relevant to your situation, please do not hesitate to open a new support ticket with us.

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 3 replies, has 2 voices.

Last updated by Waqas Bin Hasan 1 year, 2 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
November 7, 2023 at 7:19 pm #14751153

rinkd

Dear sir/madam,

I recently opened ticket (https://wpml.org/forums/topic/changing-slug-of-a-user-role/), upon which you or a colleague of yours responded. However, I was so busy with everything else besides the website, that I did not have time to respond and the ticket got closed. Is there a way to pick up where we left? I'd gladly provide access to the website.

Best regards,
Ali

November 8, 2023 at 8:17 am #14753461

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Ali,

Thank you for contacting the support.

Unfortunately there's no way of translating "user role slug" in WPML. Although you can translate other user meta (see https://wpml.org/documentation/getting-started-guide/string-translation/translating-user-meta-information-with-wpml/ and https://wpml.org/errata/get_user_meta-is-not-returning-translations/).

However, can you please explain a little more that where these roles are coming from and how do you access these in frontend (i.e. example URLs)? So I can check with my team for any possibility.

Regards.

November 9, 2023 at 9:07 pm #14771189

rinkd

Hi Waqas,

Thank you for your reply.

Sure thing! The roles are generated by the system of my theme (MyHome). Here is an example of the main/Dutch site: hidden link

Here is an example of the same profile on the WPML/English website: hidden link

The slug is still /verkoper/, while I want it to be /seller/. Is there anything we can try?

Thank you for your time and efforts.

Best regards,
Ali

November 10, 2023 at 5:38 am #14772331

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Well, I meant about the technical details for understanding how the roles and slugs are being generated. For example, some can use CPTs (Custom Post Types) to create such things while presenting as mocked roles. In this case, CPTs can be translated via WPML (https://wpml.org/documentation/getting-started-guide/translating-custom-posts/).

But the actual user role slugs, can't be done with WPML.

I you prefer, I can to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security.