Please make sure to update to WPML 4.3.4 before reporting any issue

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 thread is resolved. Here is a description of the problem and solution.

Problem: How can I display all content for all languages using Fallback?

Solution: The fallback option only works for posts created in the default language. So, if you don't translate a post that is created in the default language, the secondary language will fallback to the default language. It does not work in the opposite direction, however. So you can't fallback to a secondary language if the post is not translated to the default language. So as far as your example goes, $fallback_language = default language. Fallback language cannot equal anything other than the default language. I hope this makes sense.

You can use this setting on any custom post types by going to WPML -> Translation Management -> Multilingual Content Setup.

This topic contains 5 replies, has 2 voices.

Last updated by johnS-9 1 year, 6 months ago.

Assigned support staff: Lauren.

Author Posts
April 30, 2018 at 10:51 am #1894294

johnS-9

I am trying to:
See posts (or any post type) in both languages using the new language mode: "Translatable - use translation if available or fallback to default language".

---

I expected to see:
In English mode:
- A - Translated item (english)
- B - Non Translated item (french)
- C - Another Non translated item (english)

In French mode:
- A - Translated item (french)
- B - Non Translated item (french)
- C - Another Non translated item (english)

---

Instead, I got:
In English mode:
- A - Translated item (english)
- C - Another Non translated item (english)

In French mode:
- A - Translated item (french)
- B - Non Translated item (french)
- C - Another Non translated item (english)

---

The most info I've been able to find is:
https://wpml.org/forums/topic/how-to-show-all-news-blog-posts-in-both-languages/

"Please note that this setting affects only blog posts queried by the main loop in a theme's index.php template."

How can I use the mixed language results functionality on any query? Is there a filter I can use?

It seems to be working if I'm not viewing the default language, as the french version shows me the untranslated english items.

However the English page doesn't show me untranslated non-english items.

April 30, 2018 at 11:06 am #1894598

johnS-9

Having looked at WPML's core files

wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-display-as-translated-query.php::28

I think what I'm trying to achieve is:

In English:
$current_language = 'en';
$fallback_language = 'fr';

In French:
$current_language = 'fr';
$fallback_language = 'en';

Any advice much appreciated, thanks.

May 1, 2018 at 7:04 pm #1916726

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

The fallback option only works for posts created in the default language. So, if you don't translate a post that is created in the default language, the secondary language will fallback to the default language. It does not work in the opposite direction, however. So you can't fallback to a secondary language if the post is not translated to the default language. So as far as your example goes, $fallback_language = default language. Fallback language cannot equal anything other than the default language. I hope this makes sense.

You can use this setting on any custom post types by going to WPML -> Translation Management -> Multilingual Content Setup.

May 2, 2018 at 7:40 am #1923208

johnS-9

Hi Lauren,

Thanks for the reply.

Do you know of any way I can show both languages of content at the same time? (Excluding multiple versions of the something if it's available in the current language).

The main benefit to the language switch for this site is the interface, menu, etc changing. The content is just to show one version of each post.

(Sorry, I know this is a weird ask...)

May 2, 2018 at 1:19 pm #1932864

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-05:00)

I would suggest Duplicating the posts that are not translated. This will create a copy in the second language and the language will show the same as the original post. Then, if you decide later you want to translate the content you can click "Translate Independently". Please see this documentation which helps explain how this will work: https://wpml.org/documentation/translating-your-contents/displaying-untranslated-content-on-pages-in-secondary-languages/using-content-duplication/

Please let me know if you need any further assistance and I will be happy to help.

May 9, 2018 at 7:05 am #2044309

johnS-9

Hi,

Ok, makes sense! Thanks. I've tried to explain this to the client but they're not being very accommodating/willing to work with how WPML works. (They don't see why they should have to duplicate everything they create... *insert eye roll emoji here*).

I've put something in place to force the default language to swap, if that proves to be problematic I'll see if I can automatically duplicate content on publish.

Thanks.