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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+02:00)

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Dražen 1 year, 10 months ago.

Assisted by: Dražen.

Author Posts
July 25, 2023 at 11:09 am

martinH-133

so the english slug won't get translated in the menu

July 25, 2023 at 11:50 am
July 25, 2023 at 12:04 pm #14096189

Dražen
Supporter

Languages: English (English )

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

Hello,

I have escalated the case to our compatibility team, as I have been able to reproduce it on clean sanbdox.

They will check further and confirm this bug, and provide if possible workaround for you.

I will update you soon.

Regards,
Drazen

July 25, 2023 at 2:19 pm #14097269

martinH-133

Hello,

just to add to that issue, the sitemaps that are provided by rankmath are also using the wrong slug.

July 26, 2023 at 7:36 am #14100319

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for sharing this.

I will update you when I have more news.

Regards,
Drazen

August 1, 2023 at 6:40 am #14130539

Dražen
Supporter

Languages: English (English )

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

Hello,

we will be checking for permanent fix, but in the meantime, you can use the next workaround:

- Open the wp-content\plugins\seo-by-rank-math\includes\modules\woocommerce\class-permalink-watcher.php file

- On Permalink_Watcher::term_link(), around line 124, replace the following snippet:

$permalink_structure  = wc_get_permalink_structure();
$category_base        = trailingslashit( $permalink_structure['category_rewrite_slug'] );
$is_language_switcher = ( class_exists( 'Sitepress' ) && strpos( $link, 'lang=' ) );

With:

$permalink_structure  = wc_get_permalink_structure();

// WPML Workaround for compsupp-6895
if ( class_exists('Sitepress') ) {
	$args = array('element_id' => $term->term_id, 'element_type' => $taxonomy );
	$term_language_info = apply_filters( 'wpml_element_language_details', null, $args );
	$permalink_structure['category_rewrite_slug'] = apply_filters('wpml_translate_single_string', $permalink_structure['category_rewrite_slug'], 'WordPress', 'URL '.$taxonomy.' tax slug', $term_language_info->language_code );
}

$category_base        = trailingslashit( $permalink_structure['category_rewrite_slug'] );
$is_language_switcher = ( class_exists( 'Sitepress' ) && strpos( $link, 'lang=' ) );

Regards,
Drazen

August 7, 2023 at 5:04 pm #14165539

martinH-133

To keep this open, (cleanup robot was messaging me),
There still is a permanent fix missing

August 8, 2023 at 6:28 am #14166849

Dražen
Supporter

Languages: English (English )

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

Hello,

I will mark this as Escalated to the Compatibility team, and update you when there is a permanent fix released in our versions. In the meantime you can use suggested workaround fix.

Regards,
Drazen