0

My nodes, with entity translation enabled, need to be able to handle a node where the content of the node is displayed differently regarding the labels and menus.

Let's say I am on a french page, displaying a list of all nodes, translated into french or not. If I click on a non-translated projects url I need the node to be displayed in a french environment (menus and labels in french) but displaying the node in its original language.

Any idea how to achieve this?

1

This is more or less the default behavior, depending on your Languages Detection and selection configuration.

In Drupal 7 every translation of a node is a new node, with its own node ID. So when you call for that node it will be displayed (call it by node/[nid] or a path alias).

Interface language (menus etc) is calculated separately from content, by the Detection and selection settings (/admin/config/regional/language/configure).

The most common setting is to only enable the URL Detection method and configure your default language not to use the Path prefix language code or Language domain and set one for all the other languages.

This way if you have an English node and you want to open it with a French interface the link should be constructed as:

/fr/node/[englishID]

or

/fr/[french-path]/[english-title-pattern]

So whatever method you're using to display node lists you have to adjust their URLs output to follow that logic.

  • Perfect, that seems to work as wished – abelass Oct 5 '18 at 7:01

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.