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.
In the latest dev the tabs can be now translated, but I cannot get the title of the quicktab to translate inside a panel in any way. I added the t()-function to the quicktab.module and now it seems to work. I'm not sure if it's good practice to do it that way, but here is a patch anyway.
Comment | File | Size | Author |
---|---|---|---|
translate_title.patch | 486 bytes | mErilainen | |
Comments
Comment #1
PasqualleThe proposed patch is wrong. The tabs should be translatable with the i18nstrings module.
and it should be working properly as there was a fix lately #668698: Tabs translation
Comment #2
mErilainen CreditAttribution: mErilainen commentedAs I said, I can translate tabs, but not the block titles of the quicktabs. I'm not sure if there is a problem when I'm trying to use them with panels, but with the patch it works well.
I have tried to clear caches, refresh the quicktabs and blocks translations, but I just wont get them visible to the search to translate them.
Comment #3
Pasquallecan you translate other block titles? other blocks, that are not QT blocks?
The patch works, but the patch is wrong. Block titles are not translated in Drupal by default.
If you really want it you should add t() to block.tpl.php or (block-quicktabs.tpl.php)
Comment #4
mErilainen CreditAttribution: mErilainen commentedIs there anything bad adding the t()-function? I haven't seen it used in themes often.
I actually added that to my development installation, but I never committed that to our production server. The patch was committed and I cannot translate quicktabs block titles without it. Most of the other block titles have been translated. They are mostly views blocks, custom blocks (without titles) or blocks from 3rd party modules.
Comment #5
Pasquallehttp://api.drupal.org/api/function/t/7
http://groups.drupal.org/node/15177
Comment #6
mErilainen CreditAttribution: mErilainen commentedYes I remember I read something related to it.
Anyhow, I think we have managed to translate the block titles with Block translations module which is part of i18n. But for some reason any block created with Quictabs just cannot be translated.
Comment #7
Zardoc CreditAttribution: Zardoc commentedTranslatable block titles in panels:
When a block is used in panels as content, in order for the title to be translatable the title used in the "title override" section of the content settings form in panels must match the title set in the "title override" section of the block configuration page in admin/build/blocks. This way i18nblocks will recognize the string and add it to the translate interface for translation and panels will use the appropriate title translation when rendering the block.
Comment #8
quitos CreditAttribution: quitos commentedHmmm not true Zardoc, I have a block titled "History" inside a panel tab-style, I have translated History to its spanish "Historia" and the title is always "History" regardless of language negotiation. If I put the block in a normal panel (not tab-style), the title is translated accordingly.
If I use title override in the panel options and set it to "History" (the same title as the block) the title is displayed as "History" but the problem remains, language negotiation doesn't change the title in the tabs.
If I use title override in the panel options and change it to say "Story" the title is displayed as "Story" but i18n doesn't recognise the new title string and thus I cannot translate it.
I'm using Panels, Blocks and Tabs panel style.
Comment #9
yngens CreditAttribution: yngens commentedsubscribe
Comment #10
petermallett CreditAttribution: petermallett commentedEdit: sorry, I just re-read the thread; I didn't pick up on this being specific interaction between your blocks and Panels. Sounds more likely to be an issue between Panels and i18nblocks. However, I'm not familiar with Panels.
----
Block titles are handled by the i18nblocks module.
Go to admin/build/block and edit your quicktabs block (eg. admin/build/block/configure/quicktabs/1) and make sure the Multilingual settings: Language field is set to 'All languages'.
Then refresh your block text group in admin/build/translate/refresh (or just view the block in a language other than the site's default). Then the block title should show up in the "Blocks" text group when you do a search.
Comment #11
drupalninja99 CreditAttribution: drupalninja99 commentedI think the issue is that Panels calls the blocks differently so i guess it's losing the translation along the way.
Comment #12
netw3rker CreditAttribution: netw3rker commentedComment #13
danyll CreditAttribution: danyll commentedThis solution on StackOverflow worked for me.