Closed (works as designed)
Project:
Drupal core
Version:
x.y.z
Component:
menu system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Nov 2004 at 22:05 UTC
Updated:
23 Nov 2005 at 07:16 UTC
I have tried to translate the menus I have entered without any luck. I have looked into all the setup options (under administer) and also tried through localization settings searching for the strings but they do not show up in the list. I have both i18n and locale modules installed and I am able to translate all other strings.
I have entered this as a bug, but I am not sure if it should be a feature request.
Comments
Comment #1
liambr commentedComment #2
gordon commentedAll the generated menus should be able to be translated.
Whick menu are you talking about?
If you are talking about the top menu, which you have entered as part of the theme configuration, then these are not translatable, as it is just content that you have entered. What I did on my site, (but not for the reasons of translation) was that I made a modification to the theme so that the content from the menus will get passed thru the filter. This means that I can use the php filter. Doing this means that you can use the t() do be able to do any translations. (I used it for the l())
Comment #3
(not verified) commentedI am talking about the new menu module where you can enter menu options as new blocks or as part of the Navigation menu. I am not talking about taxonomy (which has an option for translation) or theme menus.
Comment #4
sangriastudios commentedI am having the same problem and it doesn't look like anyone has a solution.
Comment #5
gábor hojtsyThere needs to be a complete solution for translating all kinds of user specified data (ie. names of profile fields, even the site slogan or the user welcome message are not translateable now). Noone came up with a working solution yet.
Comment #6
r2mahara commentedSomeone is working on user menu translation here:
http://drupal.org/node/17829
Comment #7
killes@www.drop.org commenteduser input is currently not translatable.
Comment #8
ufku commentedtranslation may be done after the menu is created. This will not conflict with menu entries in database since the translation is done using the menu output. Here is an hack for menu.module's block hook. This hack will make all user created menus avaliable for translation.
replace this:
with this:
'preg replace' will replace all (word)s (beginning with a word character+any non "<" character+ending with a word character) with t(word). These words are between ">" and "</".
if you also want to see translated menu titles in admin/blocks page, you should replace "$blocks[$mid]['info'] = $menu['items'][$mid]['title'];" with "$blocks[$mid]['info'] = t($menu['items'][$mid]['title']);"
Comment #9
the_undefined commentedHey guys,
I had the exact same problem with translating menu's in Drupal so I looked around and stumbled upon this page.
So first I just copied ufkucom's hack (thx for it) but then I realised that this won't fix menu translations if I call
echo menu_tree(id); somewhere inside of my template. So what I did is the following:
I replaced this function in includes/menu.inc:
with this one:
I guess gordon actually ment exactly this when he was saying "you can use the t() do be able to do any translations. (I used it for the l())"
but oh well this is how to do it ; ).
In my oppinion this should be a little faster and a better way to to it since no regex engine needs to warm up and it virtually translates all menu
entries anywhere on the page. But be warned: If you're overriding theme functions in your own themes you have to do this fix in your version of
theme_menu_item_link. Otherwise it's not going to work.
I hope this helps somebody,
bye, Felix
Comment #10
the_undefined commentedsry, changed the title of this issue, thought I would just set the title for my comment on it. Setting it back now ^^.
Comment #11
chx commentedThis is not a bug, this is a feature request hence goes against 4.7
Gerhard, translations are your field of expertise, what do you think?
Comment #12
chx commentedops. I found killes' answer. So then this is delegated to i18n realm.