This patch adds language handling to the menu settings on the node form. It sets the language of the created menu item to the language of the node and sets defaults for link_title and weight based on the menu item associated with the source translation.

Also, moves the existing form_alter code into i18nmenu_form_menu_edit_item_alter() to unclutter the form_alter hook.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

Nice. This patch is a necessary compliment to #339057: Performance: menu translations continuously updated.

It would be good to look at doing as much as we can of this in hook_nodeapi()'s 'prepare translation' op, where we might be able to affect the form before it's generated.

I suspect we need to consider whether the menu item is translatable, by testing it's language value.

I'll try to look at this again later in the week.

stella’s picture

FileSize
2.23 KB

Same patch, just re-rolled against latest DRUPAL-6--1

stella’s picture

Assigned: Unassigned » stella
nedjo’s picture

Issue tags: +i18n sprint
stella’s picture

FileSize
2.75 KB

Slightly modified version of the patch. It uses hook_nodeapi() on 'prepare translation' to set the menu title, etc. This forces the 'menu settings' collapsed fieldset to be expanded, which makes it more obvious users that they are also creating a menu item.

catch’s picture

Status: Needs review » Needs work

This patch adds a duplicate i18nmenu_form_alter() - is it missing the removal of the old one?

stella’s picture

Status: Needs work » Fixed

This patch has already been committed, so that's why a duplicate function was added when the patch was applied.

Cheers,
Stella

Jose Reyero’s picture

Sorry, I had committed the patch but forgot to update the issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

co_maximago’s picture

Does anybody know if this patch has been backported to D5 too?
I'm having the same issue using D5 with i18n 5.x-2.5 and am desperately looking for a solution.

Thanks in advance.