Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
// Get the default block name.
$menu_names = menu_block_get_all_menus();
menu_block_set_title(t($menu_names[$config['menu_name']]));
In the shown code the menu names are translated. The problem is that menu_block_get_all_menus()
already returns translated strings making a translation of the already translated name.
Comment | File | Size | Author |
---|---|---|---|
#4 | menu_block-use-i18n-string-translate-for-menu-title-1909366-4.patch | 969 bytes | alexverb |
#1 | menu_block-double_translations_of_menu_names-1909366-1.patch | 485 bytes | lund.mikkel |
menu_block-double_translations_of_menu_names.patch | 633 bytes | lund.mikkel | |
Comments
Comment #1
lund.mikkel CreditAttribution: lund.mikkel commentedWrong path :S
Comment #2
JohnAlbinYep. I dug into the underlying function calls. You are correct.
Fixed. http://drupalcode.org/project/menu_block.git/commitdiff/f761d34
Comment #4
alexverb CreditAttribution: alexverb commentedIt looks like this is a case of inappropriate use of the t() function. I couldn't get the menu title appear translated in any way. The following patch against 7.x-2.x fixes this issue.
I don't know if menu_get_menus() is in the wrong here but don't have time to dig in to this issue.
Hope this helps...
Comment #5
Dave ReidWe cannot rely on a i18n module function without it being a dependency.