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

Last updated by Yvette 2 years, 11 months ago.

Assigned support staff: Yvette.

Author Posts
December 11, 2018 at 8:06 pm #2990262

heikeS-5

I am trying to: Show Project categories in different languages

Link to a page where the issue can be seen:
All categories are shown (lower right corner of image) on English site:
hidden link

German site shows on those categories where I have set “Overwrite with English content” for German for ONE project of a particular category:
hidden link

I expected to see:I have some projects available in English language, these are not translated, but also visible in other languages like German. Showing them in English I get the project category in the lower right corner of the image. When choosing German language this category is not displayed, neither in the image nor on the project category site (below header). The categories are translated into German language. I don’t want to translate the projects onto German. I am using English as the default language. Means English has been translated to German.
Now when I translate the project using “Overwrite with English content” I get a funny behavior.
Suppose I have two projects with the project category “vehicle”.
If I translate ONE of the TWO projects using above method, I will get the project category displayed in all projects having project category “vehicle”.

The Provider of the plugin I am using (IgnitionDeck) wrote: This sounds like a WPML configuration issue, as we just print categories via standard WordPress methodology. There’s nothing special there:

$terms = wp_get_post_terms( $post->ID, ‘project_category’);

Instead, I got:

December 12, 2018 at 10:50 am #2992859

Yvette
Supporter

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

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

Hello

I am not sure that I understand that whole issue. I have visited your site and I can see that only one project is missing the text in the image corner (see images).

1. The Problem
You wrote: "When choosing German language this category is not displayed, neither in the image nor on the project category site (below header)."

Does this one project illustrate the problem you still have?

2. Translation of Categories and Projects
You wrote: "The categories are translated into German language. I don’t want to translate the projects onto German."
I understand that you wish to translate the categories but NOT translate the projects.

In this case, you would need to DUPLICATE your projects to the various languages you have active on your site if you want them to appear. The custom post type translation setting "Appear as translated" will not work if you are translating your categories.

This is what normally happens when you select "Overwrite with English content". This is the same as creating a "duplicate". It will need to be done on all projects for which the category has been translated.

Does this explain the behaviour on your site?

I wait for your feedback on my questions.

DEProjectsPage.png
ENProjectsPage.png
December 13, 2018 at 6:39 am #2996291

Yvette
Supporter

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

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

1. Settings
Your attachment did not load, please try again making sure the images are <1M in size or they will not load onto the forum.

2. Categories and Post Type translation
You wrote: "I don't want to duplicate the projects, I would only like to translate the categories."

I need to make a correction to what I wrote earlier.

I was able to achieve this with regular posts bye setting the following tranlsation options in :

WPML > Settings > Post Type : set the project to be middle option "Translatable - use translation if available or fallback to default language"

and set the related category
WPML > Settings > Taxonomy Translation : set to first option "Translate"

In my test system, this allowed the archive page to show non-translated posts under a translated taxonomy.

December 14, 2018 at 7:09 pm #3002858

heikeS-5

Hello Yvette,
I tried trice to upload my comment and images, but I got always an error message.

My actual configuration you can find in the attachment.

Tomorrow I will try out your suggestions.

Thank

Peter

Settings 3.PNG
Settings 2.PNG
Settings 1.PNG
December 15, 2018 at 3:43 pm #3004496

heikeS-5

Hello Yvette,
the WPML setting you are mentioning I am already using.

See the attached images.

Do I miss something?

Regards

Peter

Settings 5.PNG
Settings 4.PNG
December 17, 2018 at 8:06 am #3006998

Yvette
Supporter

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

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

Ok - woudl you mind if I took a closer look at your site?
Am I permitted to temporarily deactivate/activate plugins for troubleshooting if required?

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.

December 17, 2018 at 4:16 pm #3009343

Yvette
Supporter

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

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

Hello

For some reason, this is not working for me. The system is accepting the userid/login but I do not get the dashboard - it remains on the login screen.

can you try these credentials and tell me if you get the same result?
hidden link
My expected result: dashboard
The result: login screen

Thanks for advising

December 17, 2018 at 4:28 pm #3009381

heikeS-5

Sorry my mistake:

<removed by WPML Support>

December 18, 2018 at 11:31 am #3011769

Yvette
Supporter

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

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

Hello

I took a look at the template that is showing your project grid on the home page. The reason it is not showing the project category title is because it is not coded to handle the case where the projects are "appearing" as duplicated. So, this is a compatibility issue.

For the name to appear in non-translated posts, the template logic would need to change to account for the possibility that the post will "appear as translated" even if it is non-existant in the database.

I try to illustrate this by including the images of the tempalte logic and the reality of the database it is querying. You need to be familiar with coding to appreciate the situation...but suffice to say
that the template you are using is not able to handle the situation of WPML´s "appear as translated" and would need to be changed to handle it.

I wait for your feedback.

TemplateLogic.png
December 18, 2018 at 3:18 pm #3012752

heikeS-5

Hello,
thanks for having such a close look into my issue. I have forwarded your reply to the template supplier.

Waiting now for his reply. I will keep you informed.

Regards

Peter

December 18, 2018 at 5:50 pm #3013304

Yvette
Supporter

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

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

Sure.

To be specific, the line of code that he needs to consider is line 65:

if ($term->count >0){

With the WPML setting, the translated terms may have no posts assigned due to the setting "Appear as translated" but still have posts that appear on the frontend.

Since this is a custom coding issue, I am going to mark this ticket as resolved and you can close it when you want.