the i18n module integration to translate menu doesn't work because module name and function return are wrong. see the attached patch

Comments

stred’s picture

Status: Active » Patch (to be ported)
Anonymous’s picture

I had the same issue and the patch worked like a charm.
Thanks!

amateescu’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
StatusFileSize
new837 bytes

The patch from the OP is correct, but has some indentation and file path problems.

Here's a re-roll (with proper credit to stred).

openWeb’s picture

Not sure what's wrong here but the patch does not change anything - even after multiple cache-clear...

I have a page with 4 languages, first started with Englisch and German, French and Spanish will follow later...

Have created a simple menuitem that links to , Startseite. After Translating this menuitem ("homepage") and applying the patch, still both items are shown in the nice-menu. The links both change according the selected language though...

amateescu’s picture

I assume you are using Drupal's main menu.

What are your settings in admin/structure/menu/manage/main-menu/edit? And can you post a screenshot of admin/structure/menu/manage/main-menu/translate?

Also, how are you outputting your menu? With a theme function inside a template or from a nice_menus block?

openWeb’s picture

StatusFileSize
new19.96 KB
new31.49 KB

Here are the requested screenshots...

I am using one of the generated nice-menu-blocks.

The whole translation-thingy is working if i place e.g. german articles in the menu andtranslate them to english.

Thanks in advance,

Jens

amateescu’s picture

As I suspected, the problem is that those menu items are not linked together as a translated menu item. You should use the 'ubersetzen' link to do that :)

openWeb’s picture

Oh, they are translated, see attached scrrenshots...

amateescu’s picture

Everything looks ok to me. Are you sure you applied the patch from #3 correctly?

openWeb’s picture

i really did not apply the patch, i found out the typo before and fixed it manually - after that i found this thread and the patch ;-)

Correct lines on server:

// Allow i18n module to translate strings where available.
if (module_exists('i18n_menu')) {
i18n_menu_localize_tree($menu);
}

Anonymous’s picture

I had the same problem ... I updated the file manually but forgot some "_" and it cost me 2 days of work!

As stated on the patch the correct code must be:

// Allow i18n module to translate strings where available.
if (module_exists('i18n_menu')) {
$menu = i18n_menu_localize_tree($menu);
}

openWeb’s picture

Hi... I changed my code (seem to be blind), emptied cache 3-4 times -> no difference... Still have "Startseite" besides "Homepage"....

amateescu’s picture

I'm running out of ideas here.. What is your i18n version?

openWeb’s picture

It's 7.x-1.0-beta6

amateescu’s picture

Hmm, can you upgrade to beta7?

openWeb’s picture

It works!!

the server did not show up the new i18n-version, but after updating everything works like expected... Thanks a lot!

czigor’s picture

The patch worked for me, thanks!

vordude’s picture

Committed with cc80852ab22fd046. Thanks.

vordude’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

didaka’s picture

Status: Closed (fixed) » Active
StatusFileSize
new949 bytes

When menu item is set to language neutral and is only localized nice menu renders unlocalized title with
'#title' => $menu_item['link']['link_title'],
What fixes the problem is to set ['link_title'] to ['title']
Patch is attached bellow.

natuk’s picture

Indeed #21 solves this problem for me as well.

Thanks

tribsel’s picture

Status: Active » Reviewed & tested by the community

yeah,that (#21) worked for me too.

nicolas bouteille’s picture

Yeah ! #21 made it possible for me to work with Entity Translation and keep the same menu item for all languages (making it neutral) but allowing to translate the title and description.

fraweg’s picture

Hello,

for me this #21 patch does not work. Must I use patch #3 together with #21?

Thanks for any help!

Best regards
Frank

Wuk’s picture

Frank,
Try patch from comment #17.
Those patches are made against clean latest 2.x-dev and clean 2.1 version.
If it works, please, close this issue as duplicate of that issue.

Kind regards,
Wuk

fraweg’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Bingo! with comment #17 everything works! Thanks a lot!
Frank

kristen pol’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Not sure why @fraweg closed this... the patch from #21 still needs to be committed. It makes Entity Translation menu items work.

Wuk’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

He closed it because it's a duplicate of translated menu items displayed in the default language.