I want to have exactly the same menu links and structure for all laguages with only Menu link and Description localized. I see that entity menu translation works well for that. All necessary modules enabled.
Now I am creating node in my default language with unchecked button Menu link enabled only for the XXXX language - it works like it should work. Then I create translantion for all languages needed - also with unchecked Menu link enabled only for the XXXX language. Everything works great - One menu link, translanted in all laguages.
The bug is, that when I edit previously created translation of the node on edit node form, the value of Menu link and Description is not localized, but now is loaded the Source language value of Menu link and Description.
When I check Menu link enabled only for the XXXX language, everything works fine, but menu is little bit messy. Mybe that something is missing in hook to load localized values for menu link fields on edit node form.
BTW: Great work!
Comment | File | Size | Author |
---|---|---|---|
#6 | et-i18n_menu-regressions-fix-1941080-6.patch | 3.28 KB | bforchhammer |
#5 | translate_link_title-1941080-5.patch | 638 bytes | plopesc |
Comments
Comment #1
plachThis might be related to #1889084: Menu translation tests broken. Please provide enabled modules and their versions.
Comment #2
danielbehina CreditAttribution: danielbehina commentedThank you for your response. It looks like trouble with i18 module: Menu translation is broken, see #1888512: Saving a node breaks menu translation. I will try to downgrade i18 to 7.x-1.7 and will see...
Comment #3
joel_osc CreditAttribution: joel_osc commentedI think I may have some info to help track this one down...looking at the following code in the i18n_menu.module:
It looks like $link['title'] is set - which is the menu_router title, but $link['link_title'] is not set. Adding
$link['link_title'] = _i18n_menu_link_title($link, $langcode);
after line 491 seems to fix the issue. I am not really sure this is the correct fix which is why I have not posted a patch to i18n_menu, but I thought I would throw it out to the community to hear some thoughts.
Comment #4
attisanhad the very same problem - I changed entity_translation_i18n_menu_node_menu_item_translate in line 267 file entity_trnalsation_i18n_menu.module
from
to
hope this will get fixed soon as it's a major thing to have string translated menu (I did never see the point in having extra menu items for every language -> retro style like having a node for each language instead of ET-ing it).
greets,
attisan
Comment #5
plopescHello
Attaching a patch that fixes this issue based on attisan's approach. This patch is tested against the environment detailed below:
Regards!
Comment #6
bforchhammer CreditAttribution: bforchhammer commentedThanks for the patch. I think this is the correct approach.
I added support for the link description, and fixed an issue with translation sets ("separate menu items"); I think this should make the ET menu tests pass again. Let's see what the bot says :)
Comment #7
bforchhammer CreditAttribution: bforchhammer commentedBot is green, so I went ahead and committed #6. :)
Comment #8
plachCool, thanks!
Comment #9
attisanawesome!
Comment #11
aimara CreditAttribution: aimara commentedhello,
I'd highly appreciate if someone could help me out. I've trying to add this patch http://drupal.org/node/1941080#comment-7293146 to my project, in the specific place it should and it always fails. I am assuming it is the patch because I tried with others and worked perfectly. I'm using NetBeans 7.0 to add patches to my project. Currently working with Drupal 7.22.
Any suggestions?
Thanks in advance.
Comment #12
bforchhammer CreditAttribution: bforchhammer commentedThe patch has been committed already, so just use the development version and you should be fine. If something still isn't working correctly, please create a new issue following the bugfixing guidelines outlined on the project page.
Comment #13
danielbehina CreditAttribution: danielbehina commentedWorks great in dev version. Amazing work, guys. Thank you.
Comment #14
schifazl CreditAttribution: schifazl commentedI had this exact issue with the latest version of Drupal and with the latest stable versions of i18n and entity_translation. After reading this bug report I tried to update to the dev version of i18n and entity_translation with no luck, this bug is still present. I had to disable the entity translation menu for the moment.
Comment #17
kopeboy CreditAttribution: kopeboy commentedSo, I had the latest stable release, and there is the bug.
I went to dev and the bug is still present.
If the patch is actually included in latest dev, it doesn't work.
Let me clarify:
I have the main menu translated with entity translation menu. That creates duplicate entries in admin/structure/menu/manage/main-menu for each language the menu link is translated into.
The module works ok everywhere (only showing the menu links of the chosen language) except for all these pages: node/xxx/edit
When you are editing a node (every node, translatable and untranslatable ones) all the menu links translations are shown, i.e. every menu link is shown twice if you have 2 enabled languages.
The bug is independent on how you added the menu link, being it a custom one, from views, from panels etc.
Comment #18
kopeboy CreditAttribution: kopeboy commentedComment #19
kopeboy CreditAttribution: kopeboy commentedComment #20
kopeboy CreditAttribution: kopeboy commentedThe workaround for me was to delete the translated menu links and translate them with i18n_strings.
The setting in the menu is "Translate and localize".
So, can anyone remind me what is Entity translation menu for?
Is it useful only if we don't use string translation on the whole site (which will never be the case in Drupal 7)??
Or was it me misunderstanding how this module should be used (i.e. only with Menu setting "Fixed Language. Menu items will have a global language and they will only show up for pages in that language.")??
Thanks
Comment #21
jide CreditAttribution: jide commentedI did update both i18n and entity_translation to latest dev, and like @kopeboy, I had no luck making this work. This is unfortunate, since in real life, people do want to use menu items, and without them it almost makes the whole entity_translation module useless.
Comment #22
Bohus UlrychHello, thank you for your work on this module.
I agree with above that this patch doesn't work with the latest dev version 7.x-1.0-beta3+14-dev.
In my case - just one language version - this "Menu translation: Menu link enabled only for the .. language" didn't worked as expected. Once I checked this I was not able to uncheck it again.
I believe that problem is in the $tset variable in the entity_translation_i18n_menu.module. It expect values 0 or 1, but in my case the right option is LANGUAGE_NONE ( = und).
I put this on line 55 and my issues seems to be solved.
if (!$tset) {
$node->menu['language'] = LANGUAGE_NONE;
}
Comment #23
gnucifer CreditAttribution: gnucifer commentedAs far as I understand it, this is the same issue as the same I'm adding as related? I have this a lot of thought, and perhaps the proposed solution in #2724111 could be a viable option.
Comment #24
gnucifer CreditAttribution: gnucifer commented