Skip Navigation

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.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Kor 2 days, 13 hours ago.

Assisted by: Kor.

Author Posts
October 25, 2024 at 3:45 pm

Kresimir

Background of the issue:
I am trying to translate a custom post type (CPT) 'author' into Croatian using WPML with the 'Translatable (use translation if available or fallback to default language)' option. The original slug is 'author', and I'm translating it to 'autor'. The CPT is registered with a plugin, and here is the code for that: hidden link. I am using WPML plugins and the Twenty Twenty-One theme with no modifications. I have another ticket open which is not related to this: https://wpml.org/forums/topic/translate-cpt-slug/. The issue can be seen here: hidden link

Symptoms:
The permalink for the Croatian version of the post is 'hidden link' instead of 'hidden link'. The word 'author' is not translated to 'autor', although the language switcher in the footer uses the correct link.

Questions:
Why is the slug 'author' not translating to 'autor' in the permalink?
How can I ensure the translated slug appears correctly in the permalink?

October 25, 2024 at 4:13 pm
October 27, 2024 at 8:55 pm #16335404

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I've escalated this to our 2nd Tier Support and they will check and revert by to us as quickly as possible.

October 29, 2024 at 6:46 am #16340271

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

Our 2nd Tier Support checked and this is a known issue and our devs are working on a fix. I will get back to you once I've feedback.

November 5, 2024 at 2:08 pm #16367171

Kresimir

Hey Kor. Any news on this? It's been a week and we have a site to launch for our client that is using this functionality. Hope you can help.

November 5, 2024 at 2:14 pm #16367184

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your response.

I've reviewed the report status, and I can confirm it’s on our dev team’s to-do list. Unfortunately, I don’t have any updates or workarounds at this time, but I’ll definitely get back to you as soon as I have feedback.

December 26, 2024 at 9:48 am #16546559

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

We have a solution and this is how it works now hidden link . You'll notice that the permalink for the Croatian version of the post is now using hidden link

To fix this, navigate to wpml-string-translation/classes/slug-translation/class-wpml-slug-translation.php line 129

add the following code.

	if( $this->sitepress->is_display_as_translated_post_type( $post->post_type ) ) {
			$ld->language_code = apply_filters( 'wpml_current_language', null );
		}

You can check it out here hidden link . Let me know how it goes.

December 31, 2024 at 9:42 am #16555297

Kresimir

Hey Kor. Thank you for the fix. I can confirm it's working. Do you know when will the change go in to WPML String Translation? I'm asking just so we know so if the next version doesn't have the fix it that we add it back in after we update the plugin.

December 31, 2024 at 9:44 am #16555300

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Sorry, I don't have any ETA's for that but I've just shared your feedback with our devs.