I have a main menu with translation set to

Translate and Localize. Menu items with language will allow translations. Menu items without language will be localized. 

I added an item "Home" for English, set to language: English.
Then I clicked the item's "Translate" tab and added translation + path for Arabic.

Expected result: Show 1 item "Home" in English, and the translated item in Arabic.

Actual result: both items shown at the same time.

Comments

Anonymous’s picture

Note: we are using user-account language only, so the language detection is based on the $user, not on path or domain.

Anonymous’s picture

Alternatively, using the Language neutral, which is supposed to allow for basic localization, does not work either: in both languages the Default site language is show, i.e. "Home" for both languages. The translation is never shown.

totap’s picture

Title: Translated menu items show in all languages » Translated items show in all languages
Version: 7.x-1.0-rc2 » 7.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

I have this problem too.

For example: I have menuENitem and menuPLitem. When I switch to english there show up menuENitem and menuPLitem. When I switch to polish lang there is no menu items.

I've noticed that it is when menu is created with Block menu module.

Edit: ups - this my problem is wiht 7.x-1.0-rc2 version

Edit2: I've realized that it's other issue after what happened here: http://drupal.org/node/1236450#comment-4824064

Anonymous’s picture

Title: Translated items show in all languages » Translated menu items show in all languages
Version: 7.x-1.x-dev » 7.x-1.0-rc2

@totap aha, I was actually also using 7.x-1.0-rc2. Is it solved in the devx?

jose reyero’s picture

Status: Active » Postponed (maintainer needs more info)

Are you displaying the menu through standard Drupal core blocks, links, etc?

totap’s picture

Now I'm probably know what's your problem. I have the same. The menu items shows in all languages when they depends the same path.
I.E.:
HomePL - path
HomeEN - path

and they all show uped and it doesen't matter if you changeing language on site they all stay up.

The way I've got this problem was 1 or more from below (listed in order I made):
* created taxonomy and few items + their translations
* created menu items for that taxonomies terms - translate seems work fine
* reorder items in menu - sometimes with problem, so I've make order by Edit->and set up weight manually (not by drag and drop)

I suppose the last thing could have something - it seems that drag&drop reorder don't works good. With translated taxonomy terms I have drag&drop issues too.

Today I've make only those few things and menu items showed up with all languages, but only for those items with common path (i.e. or taxonomy/term/1 - gallery in my case)

Anonymous’s picture

Title: Translated items show in all languages » Translated menu items show in all languages
Version: 7.x-1.x-dev » 7.x-1.0-rc2
Status: Active » Postponed (maintainer needs more info)

I'm using the Nice Menus module and showing in page.tpl.php like this: print theme('nice_menus_primary_links', array('depth' => 1, 'direction' => 'down', 'menu' => NULL));

>> The menu items shows in all languages when they depends the same path.

Same case, my paths are identical, I just need to translate the label. I also tried this through the Translate Interface for menu's, unsuccesfully.

totap’s picture

Hm... I think that problem is theme/module dependent. I've back to Bartik theme and it works as should.

After checking 1 thing it's something with dropdown menu items. When you have normal menu i18n works good. If you use Nice menu (for drop down list of submenus item) the issue come.

Anonymous’s picture

@totap, so you are also using Nice Menus? Ok, then we found the problem at least.
Now try to find the solution...

Anonymous’s picture

Title: Translated menu items show in all languages » Translated menu items show in all languages [Nice Menus]
Issue tags: +nice menus

Changing title to reflect our new insight.

jose reyero’s picture

Component: Menus » Compatibility
Category: bug » support
Status: Postponed (maintainer needs more info) » Active
totap’s picture

->morningtime I'm not useing nice menu module but i'm useing theme with custom primary menu with option "dropdown" like in nice menu module. When I'm turning OFF dropdown option, menu items shows correct.

totap’s picture

->morningtime I solved my problem in that way:
Useing 2 languages:
1. create taxonomy with: Translate. Different terms will be allowed for each language and they can be translated.
1a. create terms
2. create 2 menus Lang1 and Lang2 with: Fixed Language. Menu items will have a global language and they will only show up for pages in that language.
3. put this 2 menu bock in the same region

It's working for me quite good and allow use dropdown menu :)

jose reyero’s picture

Status: Active » Closed (won't fix)

Some notes about this:
- i18n localizes menus in page_preprocess()
- Any other module like nice menus, if you want the menus translated, needs to use i18n API, running the menus through i18n_menu_localize_tree()

Otherwise, we cannot fix it on i18n side, so both modules are just not compatible, which is properly docummented on i18n handbook.

Suggested workaround is creating on menu for each language, as explained in #13.

So, nothing we can do here, you can post a feature request to Nice menus for that module to handle this.

boran’s picture

It was not easy for me to follow everything above, but I think at one stage totap tried to use the Menu Blocks module?
I also found that it did not work correctly with localized menus, and the reason was an incorrect use of i18n_menu_localize_tree() - it might have changed between D6 and D7, see #1341418.
So that may also be the problem with nice menus too, actually see 1095722 it should be fixed too.

stompeduns’s picture

Solution: Go to your page.tpl.php file and change all the menu_tree functions into i18n_menu_translated_tree.

Problem solved. i18n will now translate your menu.

forexpivots’s picture

I honesty hate these recommendations to hack the core Drupal files, such as page.tpl, etc.

I had been struggling with this issue for a while, and yet the solution was so damm simple (as most of the "difficult issues")

Forget anything said above, all you have to do is:

* Delete every single menu (primary, if that's the case).
* Recreate the menus from their own page menu block.
* Don't worry about assigning weight (just drag and drop later)

This works like a charm!

Somehow, if you don't delete the menu, it seems that "traces" are left behind somewhere in the Drupal code.

Hope this helps...any questions, just ask!

forexpivots’s picture

Status: Closed (won't fix) » Active
webflo’s picture

Version: 7.x-1.0-rc2 » 7.x-1.x-dev
kidd1126’s picture

thank you very much

jose reyero’s picture

Status: Active » Closed (won't fix)

Ok, you can add it to the documentation.

Still, closing, see #14

MickL’s picture

Status: Closed (won't fix) » Needs work

When changing the menu settings to "Translate and Localize" the pages seem to have cached data. You dont have to create a new menu like #17 said. Just go edit every page and save it(without doing anything). Now the page will only show up on its own language.

In my opinion there should be a kind of batch which refactors all nodes when changing the menu translation settings.