menu title custom translation functions are called w/ appropriate args, but the result is not used. see _menu_link_translate(), maybe?

Comments

chx’s picture

Status: Active » Needs review
StatusFileSize
new4.03 KB

Also there is code duplication, oh horror! We can certainly do better. I moved all the relevant code to menu_item_localize. Not much change needed there, the patch looks bigger because I needed to indent most of that function.

becw’s picture

Status: Needs review » Reviewed & tested by the community
bdragon’s picture

Status: Reviewed & tested by the community » Needs review

(setting to cnr while becw writes up how she tested..)

becw’s picture

I'm getting two errors on the admin/build/menu-customize/navigation page:
* notice: Undefined index: map in menu.inc on line 1460.
* notice: Uninitialized string offset: 0 in menu.module on line 177.

the menu item titles are showing up correctly, though (run through the custom translation callback).

chx’s picture

StatusFileSize
new4.1 KB

Forgot to move a piece of code.

chx’s picture

StatusFileSize
new4.11 KB

The $item['map'] = $map; needs to be on its own.

becw’s picture

Status: Needs review » Reviewed & tested by the community

tested w/ 3 menu items (one each specifying title and title callback, title and title arguments, and title arguments and title callback). worked in all cases.

becw’s picture

Status: Reviewed & tested by the community » Needs review

the title of the breadcrumb link seems to be run through the custom translation function *twice*.

chx’s picture

StatusFileSize
new4.46 KB

Well, then the second call is not necessary... it's broken anyways because if a customized item is in the active trail which had a custom menu callback that would fire and overwrite the user set title.

becw’s picture

Status: Needs review » Reviewed & tested by the community

breadcrumb double-translation issue fixed, everything else still works.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

Asked chx to document $link_translate, as I tried to understand the changes made here, and this turned out to be quite unclear to me.

jvandyk’s picture

StatusFileSize
new5.51 KB

Attempt at documentation. chx, please review and comment/correct.

gábor hojtsy’s picture

Status: Needs work » Fixed

Looks better. Committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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