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.

This topic contains 3 replies, has 2 voices.

Last updated by Bruno 3 years, 1 month ago.

Assigned support staff: Bruno.

Author Posts
June 13, 2017 at 9:30 am #1297082

FilippoZ1

I am trying to: translate CPT Archive Base Slug.

URL of (my) website where problem appears: affittibreviperiodiroma.it/appartamenti/

I expected to see: if switch to ENG I want
affittibreviperiodiroma.it/en/apartments/

Instead, I got: the same slug of italian (with /en/),
affittibreviperiodiroma.it/en/appartamenti/

Steps to duplicate the issue:

1) Create a plugin that register a new post type with following lines for rewrite rules:

$rewrite = array(
		'slug'                => _x( 'apartment', 'House base slug', 'abp-plugin' ),
		'with_front'          => true,
		'pages'               => true,
		'feeds'               => true,
	);

...

'has_archive'         => _x( 'apartments', 'House Archive base slug', 'abp-plugin' )

2) translate _x( 'apartment', 'House base slug', 'abp-plugin' ) and _x( 'apartments', 'House Archive base slug', 'abp-plugin' ) with Poedit (or loco translate) saving .po and .mo files

3) Install WPML with translation management and string translations addons,
setup Italian as default language and English as second language

4) Go to WPML -> Theme and plugins localization -> Select how to translate strings in the theme and plugins -> select "Translate the theme and plugins using WPML's String Translation and load .mo files as backup " (screenshot: hidden link)

5) In the same screen, select plugin that register post type and scan for strings to translate

6) Go to WPML -> Strong Translation and find the "House Archive base slug", translate it: screenshot: hidden link (and mark as translation is complete)

6) Go to Settings -> Permalinks, and save flushing permalinks

7) navigate website archive in default language (italian) and see that the translation is correct: affittibreviperiodiroma.it/appartamenti/

8) switch to english language and (sadly) see that the archive base slug is still in italian: affittibreviperiodiroma.it/en/appartamenti/

it looks like translation is working, but not the default slug.

NB: Single CPT base slug translation is working, the issue is only with the base archive slug.

June 14, 2017 at 1:11 pm #1298204

Bruno

Hi,

Thank you for contacting us.

I will contact 2nd tier support to check on this and soon I will contact you.

Thank you.

July 13, 2017 at 9:10 am #1318529

FilippoZ1

Hello,
just pinging. Any updates?

July 13, 2017 at 2:06 pm #1318896

Bruno

Hello,

My sincere apologies for the delay.

The 2nd tier support replied that you can add a slug to the archive page, but at the moment it is not possible to translate that slug. At the moment you can append translation of the CPT slugs: https://wpml.org/documentation/getting-started-guide/translating-page-slugs/

Our developers are aware this but unfortunately, we do not have a deadline when this is going to be fixed.

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

The topic ‘[Closed] Custom Post Type Archive base slug Translation Problem’ is closed to new replies.