Menu link title not available to localize translation.

Created on 30 August 2013, almost 11 years ago
Updated 2 May 2024, about 2 months ago

Problem/Motivation

On a multilingual site with entity translation, custom menu links displayed by Nice Menus are not available to translate using l10n_client.

Proposed resolution

Having tried various combinations of menu translation settings, it appears that the custom menu link titles are not ever passed through the t() function and so are not available to localize.
A quick review of the nice_menus code and this issue https://drupal.org/node/1050352#comment-6099726 led me to try adding t() to the theme_nice_menus_build() function.

So I changed lines 594 and 626 of nice_menus.module from

'#title' => $menu_item['link']['title'],

to

'#title' => t($menu_item['link']['title']),

This does appear to work, but it strikes me that this may not be the right way to do this, or I may be missing something else completely.

Can anyone tell me if there is a better way to support menu title localization in Nice Menus?

I'm working with Nice Menus 7.x-2.5

πŸ’¬ Support request
Status

Closed: outdated

Version

2.5

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom Finn Lewis

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024