I was fighting with translation of a menu on a bilingual website until I found the reason of all problems I think.

I'm using Taxonomy Menu module which creates a menu by a taxonomy vocabulary.
i18n mode for the vocabulary is set to localize.
i18n mode for menu is set to none.

But when I save a term in the vocab, corresponding menu_link magically gets updated with language = term's language which leads to unpredictable mess: menu items start to disappear, can't be correctly translated and etc.

IMHO the correct behavior would be to reset link language to LANGUAGE_NONE if menu mode == I18N_MODE_NONE.

This could be fixed in either:

  • taxonomy_menu.module in _taxonomy_menu_save()
  • or i18n_menu.module in i18n_menu_menu_link_update()

I vote for the latter.

CommentFileSizeAuthor
#1 i18n_menu-1957360-1.patch935 bytesOnkelTem

Comments

OnkelTem’s picture

Status: Active » Needs review
StatusFileSize
new935 bytes
jose reyero’s picture

Status: Needs review » Needs work

That may work but we'd need to take care of bulk updating all terms when you change menu options, not only the ones that get edited after that.

What would be a better approach IMO is checking that menu option before hiding / localizing links. See:
i18n_menu_translated_menu_link_alter()
_i18n_menu_link_process()