It seems that Menu translation currently does not provide support for translating item descriptions.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | i18n-844208-9.patch | 573 bytes | plach |
| #1 | i18n-844208-1.patch | 2.85 KB | plach |
It seems that Menu translation currently does not provide support for translating item descriptions.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | i18n-844208-9.patch | 573 bytes | plach |
| #1 | i18n-844208-1.patch | 2.85 KB | plach |
Comments
Comment #1
plachThe attached patch allows to translate descriptions by slightly refactoring
_i18nmenu_get_item()and friends. This shouldn't be a problem as it is a private function, hence this does not qualify as an API change.Comment #2
miro_dietikerjust by skimming through the code:
how about refresh process? will the desc items be created?
why do you use 'title' as a key for the description?
Comment #3
plachYes, the strings are updated in
_i18nmenu_update_item()and possibly ini18nmenu_localize_tree().I don't :)
The key is
'menu:item:'. $link['mlid'] .':description'. However the output value used to render the menu item description is taken from$item['options']['attributes']['title'], hence the patch uses that one.Comment #4
miro_dietikeri was asking you for exactly this 'title'.. find below:
and
Can you again try to explain me, why this needs to go through the 'title' attribute and not something like 'description'?
I might need to go through the whole menu build/translation process once to understand this in full detail.
Comment #5
plachHonestly I didn't have the time to study the menu code deeply, I just realized that the value typed in the "description" field of the menu item edit form is stored in the
$item['options']['attributes']['title']; this value is copied into the$item['localized_options']['attributes']['title']field on rendering to avoid using a translated value in the item edit form. Skimming through the menu code it seems there is a native support for the description translation throught(), but only if title and description are identical (see http://api.drupal.org/api/function/_menu_item_localize/6).Comment #6
jose reyero commentedThe patch looks good.
Replying some question here, the menu 'title' attribute is the HTML 'title' attribute for menu links so everything looks fine to me.
Feel free to commit.
Comment #7
plachCommitted to the DRUPAL-6--1 branch. Thanks!
Comment #9
plachThe item description string is not removed when the menu item is deleted.
Comment #10
miro_dietikerGreat plach. Fixed it in cvs.