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.

Our next available supporter will start replying to tickets in about 6.98 hours from now. Thank you for your understanding.

This topic contains 10 replies, has 2 voices.

Last updated by Yvette 4 years, 7 months ago.

Assisted by: Yvette.

Author Posts
April 10, 2020 at 9:07 pm #5886307

Roman

Hello,
I have a website with 14000 posts in French, and 1000 posts in English.
I need the navigation (menus, taxonomies, widgets...) to be available in both languages, as it should on every multilingual site.
Within a loop - for instance on a Toolset View with parametric filters based on taxonomies - I'll have a FR terms list if site is currently displaying in FR, or an EN terms list if site is currently displaying in EN.
In both cases, I'd need all posts (both FR and EN ones) to display within the same list of results.

What would be the best way to achieve this with WPML ?

Thank you.

April 14, 2020 at 8:03 am #5901729

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Hello

If you need all posts to display in all languages in spite of the current active language, then you have the following choices:

1. Duplicate your posts to all languages
Create language duplicates of your posts in all languages. You can do this in bulk using Translation Management. This would create a duplicate copy of each of your posts and syncronise them to the content of the original language until you actually translate the content (if ever).

To do this you must have the multilingual options for the post type set to "Translatable" here:
WPML > Settings > Post type translation

2. Have the posts "appear as translated"
You could set the multilingual options of the post types to be "Translatable - use translation if available or fallback to default language" here: WPML > Settings > POst type translation
This may meet your needs depending on how the archive page is written.

3. Modify the PHP call
You could also modify the plugin/theme PHP call that selects the post types to remove the
Within the argument of WP_Query class, you can use the suppress_filters => false, e.g.:

$args = array(
     ...
     'suppress_filters' => true
     ...
);
  
$wp_query = new WP_Query( $args );
....

Relevant Documentation:

Find more details on the usage of WP_query in WordPress.

April 14, 2020 at 9:17 am #5902295

Roman

Thank you.
The pages are all generated threw Toolset.
It seems to work great in deed with option #2.
Now I'd need to translate the terms but without duplicating them. For instance the FR term "Ressource" must be called "Resource" when navigation is in English, but must still display all posts from the term.
How may I achieve this ?
Thank you.

April 14, 2020 at 9:37 am #5902611

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

OK.

In WPML > Settings > Taxonomy Translation, set the term translation option to "Translatable".
Then use
WPML > Taxonomy Translation to translate the term names.

Let me know if this works for you.

April 14, 2020 at 10:00 am #5902757

Roman

Worked great again, thank you.
Still, for some countries having the same name in two languages, the slug adds "-2".
How may I avoid this ?
Thnak you.

April 14, 2020 at 11:03 am #5903475

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

This is added automatically by our Taxonomy Translation tool. You can remove it by going to the taxonomy listing admin screen and changing the slug directly there.

If you edit the taxonomy translation again with our tool, it will add the number again if the slug iws the same in both languages so I would advise then to NOT use the Taxonomy Translation tool.

April 14, 2020 at 11:22 am #5903553

Roman

Perfect ! That's great ! Thank you.
One last point dough: on archive term pages, my taxonomy filters have disappeared in English.
Here is the FR page: hidden link
Here is the EN page: hidden link
The content (posts and CPTs) display alright, but the filters have disappeared !
Thank you.

April 14, 2020 at 12:24 pm #5904131

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Are the various filter objects marked as "translatable"? e.g. "posts" appears....but what about the types "publications", "resources", "events"....etc are these objects available in all languages?

April 14, 2020 at 12:31 pm #5904145

Roman

Yes all CPTs are available, as all taxonomies also.

April 14, 2020 at 1:15 pm #5904537

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Id have to take a look and I must admit that my Toolset skills might be a bit rusty but please let me have access to your site so I can investigate.

1. Temporary Access to your system
Please provide access to your system (wp-admin and ftp) so that I can further investigate this particular problem. The fields to provide this data are included in a private section that I will open for your next response. You can find it above the comments area. The information in this private section is only visible between WPML Support and you.

2. Please include name of your view and filter

Thanks

April 14, 2020 at 1:38 pm #5904675

Yvette
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/Paris (GMT+01:00)

Hello

I think this has to do with the fact that you have no translated content to show in English.

I installed Translaiton Management module as per this article
https://toolset.com/documentation/translating-sites-built-with-toolset/translating-content-templates-wordpress-archives-and-views/

I then duplciated one "Resource" to English. When I go to the EN view, the parameters for "Ressources" now shows up.

Do you see this?

I think now, if you translate your other post types (or at least one of each) the filter will appear.