Closed (fixed)
Project:
Internationalization
Version:
6.x-1.x-dev
Component:
Blocks
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2009 at 06:14 UTC
Updated:
14 Mar 2013 at 17:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
-Anti- commentedSubscribing. Same problem with 6.x-1.x.dev (November)
Especially with regard to menus - after creation, and enabling as a block,
there is no obvious way to translate the title. This means that you need two
menus set to specific languages rather than one menu set to 'language neutral'.
Comment #2
jose reyero commentedThis may happen when you enable i18nblocks after the blocks are already created. Temporary workaround: edit block, check multlingual settings / save block (even when unchanged).
This issue will be fixed having the block strings properly refreshing when enabling the module, see #356520: i18nblocks implementation of i18nstrings/locale_refresh()
Comment #3
-Anti- commentedThe modules were enabled before creating the menus.
How are you actually supposed to translate a menu-block title?
By using the 'Translate Interface'?
If so, when creating the menu, is there supposed to be a message
such as 'created string: menu: title:'?
Comment #4
junro commentedHello,
I think you have to create as many blocks as languages. If you don't want to translate the body, I don't know...
If you're using 10 languages, and having 100 blocks, you will have 1000 blocks...
Maybe is there another solution to translate blocks with bodies?
Comment #5
-Anti- commented> If you don't want to translate the body, I don't know...
With the release of version 1.0 stable, it appears that the stated problem has been fixed.
In other words, now you should be able to create one block with just its title translated for each language, using the translate interface (or any module providing a better UI for the translate interface). Further, in the block can be, say, a menu with 10 links. Each link can be translated using the translate interface. The other feature that seems to be fixed is the language designation (dropdown menus) of the blocks and menu items. None of that was working when I originally posted.
> [to translate the bodies of blocks] if you're using 10 languages, and having 10 blocks, you will have 100 blocks
I've no idea how to translate block bodies.
I suppose php 'if/else/case' script could be used. Or perhaps the 'language sections' module.
Comment #6
jvieille commentedI am currently on this issue.
Normally, block creation is triggered when creating a menu.
Other blocks can also be created, but in this case they never link to menus
1) A block associated with a menu comes with 1 + n language options, ie
All languages
English
French
None of these settings gives birth to translatable strings: the initial title of the Bloc/Menu does not show up in the Translate Interface
2) a bloc created directly (see above) comes with more promising 2 + n language options, ie
All languages
All languages (Translatable)
English
French
When the second option is set, Bingo: you can get to the translation interface for its title
The problem is that this true multilingual but orphean block cannot be linked back to a menu.
In other words, multilingual blocks do not work for menus
Hope this helps
Note I am using the dev version
Comment #7
Docc commentedSubscribe, menu translation is useless without being able to translate the menu title
Comment #8
-Anti- commented> In other words, multilingual blocks do not work for menus
Confirmed! I tried the normal block title translation, which worked as you described, and simply assumed the whole translation thing had been fixed. But as you explain, *menu blocks* are still without title-translation through the translate interface.
I'm sure jose will get around to this eventually, time permitting.
For the moment, it looks like we still have to use a menu-block for each language.
Comment #9
jvieille commentedYes, this is awactly what I did.
Actually, it is easy to do this way: just create as many language secific menus per actual menu and set the menu languages accordingly.
However, this means creating menu items for each language, making menu translation irrelevant as well: with such a scheme, I prefer to set the menu item strings in the corresponding language when I create this item in its secific menu rather using the quite confusing interface translation feature
Comment #10
jvieille commentedWorking on a new site, I felt into the same issue: block strings are simply not translatable for their most common purpose: menu headers.
I changed the status to bug, as the feature is said to be provided, the search string has provision for looking for blocks but returns nothing except orphean blocks.
Comment #11
jvieille commentedAlso, it is not duplicate to my knowledge
Comment #12
jvieille commentedI changed the title and category as feature request: this seems not a bug, but rather a whole missing piece of code with early documentation (normally, the doc comes after the feature, but not in this case!)
Comment #13
dweichert commentedI had the same problem and came up with the following workaround, that might also work for others:
1. Set the menu block title to
<none>in order to disable it.2. Create a block with the setting "All languages (Translatable)"
3. Give the newly created block the title you want to display and put some dummy text in the body. Make sure the block appears above the menu block.
4. Add
div#block-id * p { display: none; }to your theme's CSS (this hides the dummy text).5. Translate the block title via the interface.
Once the issue is fixed, you can just remove the extra block and set the block title to an empty string instead of
<none>.Comment #14
jvieille commentedHumm...
Ok got it.
What is step (4) for?
Waiting for a less dreadful solution...
Comment #15
dweichert commentedStep (4) is needed, because the block created in (3) will not be displayed if it has just a title and no content/body. Therefore CSS is used in (4) to eliminate the body text whilst preserving the title of the block.
Comment #16
jvieille commentedI am sorry, but I still don't understand:
"Once the issue is fixed, you can just remove the extra block and set the block title to an empty string instead of ."
What I thought basically is that you use an extra block temporarily in order to perform the string translation in the right category, then removing this block and rename the menu block using the original string.
This is what I get from "you can just remove the extra block..." and why step 4 did not seem important to me.
However, the next part of the sentence seems not to tell that "...and set the block title to an empty string instead of "
Which block: the temporarily disabled menu block or the extra block? Seems the menu block, but with an empty string, we won't get anything???
Sorry for the slow catch up
Comment #17
-Anti- commentedDon't worry, the instructions don't make any sense to me either.
For instance, step number 5 - isn't the entire thread about block titles NOT being translatable?
So if you can translate the title of a 'dummy' block, why not just translate the title of the real
block in the first place?
Comment #18
cronix commentedSubscribing
Comment #19
deepkey commentedSubscribe to this thread, menu translation is useless without being able to translate the menu title.
Yes. the current issue is still the same, the translation can be enter via the menu translation, but the menu title don't show when the language is switched.
The menu translation should be use for maintain just one menu structure with multiple translation.
Else it make no sense, imagine a site have 100+ pages with 8 languages, the admin will have to create 8 menus, create all the title and adjust the tree all over again.
I've bought the module development book from Packt, but I don't think I'll be able solve it anytime soon.
Hope that there is anyone that can assist in resolving this issue. I think this is the final step to make Drupal truly multi-language enabled.
Comment #20
najibx commentedinstead I use Menu Block module. Similarly, now you have two blocks, but refers to the same menu (which are translated by other means). Each block shall be displayed to it's respective language.
http://drupal.org/node/438164#comment-1510084
Comment #21
varenius commentedAgreed, menu translation is useless without being able to translate the menu title.
This really needs to be fixed! Subscribing.
Comment #22
drupalok commented"The menu translation should be use for maintain just one menu structure with multiple translation." (deepkey #19)
I totally agree... anything else is just not scalable!
Comment #23
leehunter commentedSubscribing.
Comment #24
Leonth commentedSubscribing
Comment #25
ermannob commentedMy solution:
create a template file specific for your menu (find the right filename using Theme developer by Devel module).
Hardcode the title you want to display in the template, wrapped in t('.....').
Example:
Then translate it with usual translation interface.
Comment #26
Leonth commentedPlease see my patch. It only adds 1 line to i18nblocks.module.
Comment #27
ermannob commentedHello Leonth,
I tried your patch but it doesn't work on a menu. Is that expected? Does it work with blocks only?
Thanks.
Comment #28
Leonth commented@ermannob: It only works on block titles. Specifically, only for titles of blocks created by menu.module.
Where is this "menu" (where it's not working) you are discussing?
Comment #29
ermannob commented@Leonth: I have a menu which is populated by taxonomy_menu. Please note that it existed before applying your patch. Maybe your patch has effect on newly created menus only?
Comment #30
Leonth commented@ermannob:
From my observation, once you view the block, the source string will appear on "translate interface" page and you can start translating. I don't really know about the inner workings of taxonomy menu so I can't comment more. I skimmed through taxonomy_term.module and I think it should be perfectly compatible... Have you tried with normal menu blocks?
Comment #31
shadysamir commentedShouldn't that be:
Comment #32
shadysamir commentedI fixed and applied the patch from Lenoth, it works perfectly. Use patch from #26 and apply fix from #31
Comment #33
freidrichen commentedThe updated version of Lenoth's patch saved my day =)
At first I didn't find the string when I searched for it, but then all of a sudden it appeared. Not sure what I did. Could the cron job be involved in any way, seeing as it suddenly started working?
Thanks alot anyway
Comment #34
najibx commentedReferring to #25, Can this be explained further please, with example. I'm not quite get it ... is it applicable for block translation such as "to translate the Language switcher block" http://drupal.org/node/367253?
Comment #35
jose reyero commentedSee #541048: Translate all custom block titles (not only custom blocks)
Comment #36
moritzz commentedI quickly patched i18nblocks and i18nmenu to make translation of menu block titles work. (This patch works for 6.x-1.4 as well as 6.x-1.x-dev).
Comment #37
yhager commentedWorks for me
Comment #38
jose reyero commentedThe patch looks ok, though it's incomplete. It doesn't handle the case where there's a custom title for the block.
Committed an improved version. Thanks.
Comment #39
moritzz commentedThank you. :)
Comment #41
terryqwerty commentedI JUST DON'T KNOW ANYMORE. I TRIED EVERYTHING AND THERE IS ALLWAYS A BUG. THERE ARE SOO MANY SITES WITH THIS FUNCTIONALITY. PLEASE PLEASE PLEASE POST A SIMPLE SOLLUTION TO THIS, OR DO A VIDEO. I'M NEW TO THIS AND INSTRUCTIONS LIKE INSTALL MODULE, CREATE NODE AND LINK TO MENU MEANS NOTHING. I TRIED INSTALLING THE I18N, INTERNATIONALIZATION, VIEWS, LOCALE, THERE IS ALLWAYS A PIECE MISSING IN THE PUZZLE. I'M SOOO TIRED OF THIS.................
IT SAIS INSTALL MODULE - I DO THIS, THEN GO THER i DO IT - BUT THERE IS NOTHING THERE, IT TAKES ME AN HOUR TO FIGURE OUT ITS A PERMISSIONS PROBLEM, THEN ANOTHER HOUR TO FIGURE OUT YOU HAVE TO LINK THIS WITH THAT. i CAN BE STUCK LIKE THIS FOREVER. ISN'T THERE A CLICK BY CLICK EXPLANATION HOW TO DO THIS, iTS ONLY (AND I'M PROBABLY INSULTING THE PROGRAMMERS HERE BUT..) CHANGING A TEXT OF A MENU WHEN I SELECT A DIFFERENT LANGUAGE, THE CONTENT CHANGES ALREADY.
Comment #42
dhills commentedI need menu title translation. Can someone tell me how to apply the patch? Thanks!