Assume I have my site translated in three languages: en (default), fr, de.
Now assume there is a node with an english original and a german translation, but no french translation.

Node url aliases in my site are multi-language as well, so I have "en/about-us" for the english "About us", and "de/ueber-uns" for the german one.

In the german menu, I want a menu item pointing to the german translation. This works fine.

In the french menu, I want a menu item pointing to the english original, because there is no german version. This does not work, because all menu items to nodes in different languages will be automatically hidden.

How can I make a menu link that points to a node in the original language?

-----

For your information, I am using the 2nd option described on this page,
http://drupal.org/node/275705
see also my comment
http://drupal.org/node/275705#comment-1788596

Thanks.

Comments

donquixote’s picture

Project: Drupal core » Internationalization
Version: 6.x-dev » 6.x-1.x-dev
Component: menu system » Miscellaneous

I notice this has something to do with i18n_selection_mode() in modules/i18n/i18n.module.

In menu_tree_check_access() in includes/menu.inc there is a call to db_rewrite_sql, which triggers i18n_db_rewrite_where() in modules/i18n/i18n.module, which depends on the setting in i18n_selection_mode().

I don't know if any of the available selection modes will do what I need.

I make this an issue for i18n module.

donquixote’s picture

Ok, I found I have to visit
admin/settings/language/i18n
and change "Content selection mode" to "Mixed..". Then it ALMOST works..

Problem:
On some pages the correct menu items are shown, on other pages some of the items are missing. Totally weird.

Setting a language for the menu item itself has no effect at all. The system will only look at the node's language.

neochief’s picture

Maybe this one will fix the link woodoo for you: #514994: Wrong path normalization in menu item

Jose Reyero’s picture

Status: Active » Closed (won't fix)

It just works as expected: this is content selection mode + the menu system. No plans for more options to override that.

donquixote’s picture

Status: Closed (won't fix) » Active

Trying to be more clear about what I perceive as a misbehavior, from a user perspective:
- Default language is german
- I'm viewing the site in english (en)
- I have two page nodes (node/1 and node/2). Each of them is available in german, one of them has a translation in english (node/3).
- The menu contains links to each of the german page nodes and the translation.
- Content selection mode is "Mixed".
- Menu translation module is disabled. I don't want the menu items as translatable strings, I want separate menu items for different languages. I also tried with this module turned on, but didn't see any changes in the behavior described below.
- I'm working with menu_block module.

Result:
- If I visit one of the german nodes (still viewing in english, en/node/1, but the node is german), I see the menu with both of the german menu items, each prefixed with en/.
- If I visit any admin pages (en/admin/...), I see the menu with the two german items, each prefixed with en/.
- If I visit the english translation (en/node/3), I see the menu with only one item, pointing to en/node/3.

What I want to have is quite obvious, I think. But it doesn't seem to be possible with the current system.
- if a menu link is pointing to a node that is in the current language or language neutral, then show it.
- if the menu link is pointing to a node in the default language that is not yet translated to the current interface language, show it.
- if the menu link is pointing to a node in the default language that is already translated, do NOT show it. (we assume that there is already a link in the destination language).
- if a menu link is pointing to a node in any other language, don't show it.
- Most important: The menu items should NOT depend on the language of the node I'm currently viewing, but the interface language defined through the URL.

Another approach would be to have a completely different way of storing menu items, where the url to node/2 would automatically be replaced by the url of the translation, node/3. This way, you would only have to set up the menu structure once. But this would have its issues, too.

donquixote’s picture

Wow, another finding..
I changed the path alias for node/3 to something else, to avoid nameclash with node/2.

Result:
- On normal pages in english (like the admin section) I see the correct menu items: en/node/1 and en/node-3-alias.
- On en/node-3-alias, the menu only shows the link to en/node-3-alias, but not to en/node/1.

donquixote’s picture

Upgrade to latest dev version doesn't help.
Using the "preserve language" module doesn't help, see http://drupal.org/node/585678.

donquixote’s picture

Category: support » bug

The problem is i18n_selection_mode() called by i18n_db_rewrite_sql() inside menu_tree_check_access().
When viewing a node, the selection mode that is returned becomes 'node' instead of 'mixed'. I have no idea why this is so, but it breaks the menu for me.

I was able to fix this by replacing i18n_selection_mode() by
$mode = variable_get('i18n_selection_mode', 'simple');

But I am not very happy with that until I get a better idea why the selection mode 'node' was introduced in the first place.

I make this a bug report, I think it's a serious misbehavior.

donquixote’s picture

I found another problem:
If a parent menu item is translated, the untranslated child items will not show up.

de: node/1, translation exists
  de:untranslated
  de:untranslated
en: translation of node/1

In english you will only see the translation of node/1.

Jose Reyero’s picture

Category: bug » support
Status: Active » Closed (won't fix)

Feel free to continue with this monologue but please don't change the issue status

velimir_alic’s picture

Version: 6.x-1.x-dev » 6.x-1.4
Component: Miscellaneous » Menus
Category: support » bug
Status: Closed (won't fix) » Active

This is not really a 'by design' behavior. I am in exactly the same situation as donquixote.

My site offers only partial content translation (i.e. on a per-item basis) and content selection is set to 'Mixed'. The default language is set to English and menu links point to English nodes. Therefore, I would expect these links to appear regardless of the current node's language.

I would expect the menu links to be displayed according to the following logic:

1. If the target node is in the current language, or
2. if the target node is in the default language, or
3. if the target node is language-neutral.

This issue probably has the same underlying cause as the issue #614548: i18n_init() not run early enough - frontpage primary menus in wrong language or dissapearing.

gnindl’s picture

Priority: Normal » Critical

Subscribing to #11.

If you have the core option "Mixed current language (if available) or default language (if not) and language neutral." configured,
modules should behave the way it is described in #11. Otherwise it's a flaw overriding the core in such a manner.

The assumption that if you translated one page all other pages must be translated too, is simply weird. This may work out for
small sites, but how are you supposed to incrementally build large sites? Translate it all at once?? I don't think it will hurt
somebody if you fall backs to the default language and language neutral (as configured).

Jose Reyero’s picture

Category: bug » feature
Priority: Critical » Normal

Ok with the status if you guys want to talk more about this.

But please don't mess with category and priority if you want any more follow up here.

That said, I'll review patches for this 'feature' if any, though I insist this is just a consistent behavior with how menu items work atm.

If you want a tip: Don't set a language to the node until it is translated, and it will show up for all languages; then create dummy translations for all missing languages. (create translation, set language, post)

barraponto’s picture

Version: 6.x-1.4 » 6.x-1.5

adding to jose reyero workaround: set content to mixed, otherwise language neutral nodes won't show up.

Jose Reyero’s picture

Status: Active » Closed (duplicate)
TimeFor’s picture

I'm confused, is this is the same issue?

Choosing language neutral as a fall back is not an option. Say we have English (default), German, and Spanish.

If Language Neutural then the menu shows on all the sites,
However if the node is translated into Spanish, then all other languages must be translated at the same time otherwise it wouldn't show up on the German site.

delboard’s picture

1. If you keep one of the nodes as "Neutral", it should show on every page.

And thats the problem, probably a bug in my opinion. Lets say you have three languages: english (default), german, spanish. Lets say the node is translated into german (including the Menu link title) and the original is set as "Neutral language". Then the original will show up when switching the page to english or spanish and the translated german version upon switchin to german. But the problem is that when you switch to german, the menu item in both languages (original and translated) will show up. I think thats incorrect functioning of the neutral language fallback, which shouldnt show neutral menu if there is a translation.

What worked for me is to create a content with nodedblock module instead of page content, because there, you can select the fallback. Anyway menu system in drupal for multilingual sites is a chalange :-)

2. Anybody knows please, if there is a way to keep administration interface in one language in multilingual sites? independent from switching the content? I guess if I create a multilanguage (or multicountry) site, I dont have to speek all 50 languages...

Gr3fweN’s picture

subscribe

jmseigneur’s picture

Subscribing.

loze’s picture

subscribe

Ludo.R’s picture

Im having the same (or close) issue.

When viewing a content that is not the same language than that of the visitor :

Viewing a french node with en/node/13, that global $language variable is 'en', all my blocks are shown in english (including breadcrumb), except for the menu block, which is shown in french.

I just need the menu to be shown in english, as all other blocks are.

I tried some addtionals modules, but with no success for now.