0

Using Entity Translation and Entity Translation Menu

On the node form, there is a section called "Menu Settings" then "Provide a menu link".

1) Create a new node, click "Provide a menu link" and put in your English menu item title. 2) Translate the node, click "Provide a menu link" and put in your French menu item title. 3) The menu item displays the french menu item title no matter which language you are viewing the site in.

The menu item's title that you created during the English version is overridden with the French menu item title. In fact, when you edit the menu item through the /admin/structure/menu interface, there is only one translation, the default. All we did was override the default translation with the french translation.

After a while I figured out how to get around this.

1) Create a new node, click "Provide a menu link" and put in your English Title. 2) Go to /admin/structure/menu/manage/main-menu, move your new menu item up or down, and click "Save Configuration". This properly sets the properties of the menu item. 3) Translate the node, click "Provide a menu link" and put in your French Title. 4) It works!

But obviously, we can't have our administrators jumping through the extra hoop. If someone can tell me if there is already a fix on this issue or if there is a hack I can do which re-saves the menu-item after it's created, please let me know

1 Answer 1

0

I created a hook to set customized=1 which allowed the menu item to be translatable without editing it directly.

function epc_menu_insert_menu_link_insert($link){
    $link2 = menu_link_load($link['mlid']);
    $link2['customized'] = 1;
    menu_link_save($link2);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.