3

I have a list of projects, mostly in english, but some are translated in French.

When i visit the French version of my website, how can I list all projects that are translated in French and if no translation is available for a specific node, display the english counterpart.

Is that something possible in the view UI ? Or I'm guessing with a hook_query_alter.

Thanks,

  • I have a similar problem. I want to fallback to default language when no translation is available in the session language. I don't want to hide links or anything, just switch language to default when needed. – Guillaume Bois Feb 25 '15 at 12:52
0

Try the Alternative Language Module. There a lot of sub modules, but the base one will give you the functionality you are looking for.

Allows a language to specify an alternative language. If a node translation for a specific language does not exist, Drupal will try to load the translation for the alternative language before throwing a 404.

This module is useful if you have multiple languages and only one language is typically translated. Rather than create all of the other translations and maintain those, the non-translated languages can load the node from the alternative language.

For example, you have the following language configuration:

  • / - US English - default
  • /en-ca - Canada English - alternative language is US English
  • /fr-ca - Canada French

There is a node /contact, you will get three URL's:

  • /contact - US English
  • /en-ca/contact - Canada English
  • /fr-ca/nous-joindre - Canada French

There are only two versions of the node, US English and CA French. The CA English uses it's alternative language and loads the US English version so all three pages work and the URL's are correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.