First off: Love Panels. Thanks for all the hard work.
I have created a custom block and am using i18n for translation with block translation turned on. When editing the block I can set the language to English only. When I use the block in a Flexible Panel it will continue to display even if the user has selected another language. If I use the block anywhere outside of a panel it will hide it if the language is not English. All other content in the Flexible Panel will appear in translated form or
Is this a bug, or feature, or am I doing something wrong?
I know I can create a visibility rule for the pane to restrict it to English but I thought that Panels would respect the language definition for blocks like it does for nodes. There is also a language neutral option for the block language which I would think should display for all languages.
Thanks in advance for any input.
Comments
Comment #1
crea CreditAttribution: crea commentedsubs
Comment #2
Enno CreditAttribution: Enno commentedI have the same problem as the original poster:
Multilingual site with i18n and language switcher activated.
Translated blocks outside panels work fine.
Language restricted views inside panels work fine (view filter: language = user language).
Translated nodes inside panels work fine.
Translated blocks inside panels don´t work: the original language of the block is always used, no matter what language the user is switching to on the site using the language switcher.
Workaround for me is to created a custom content type for the content that was originally created as a block, but would be nice to have the translation working for blocks as well. All under the assumption that I am not missing something.
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedIs block translation provided by a module? I have no idea how block translation works or at what point.
Perhaps it's only handled properly if you set the style to system block?
Comment #4
bryanhidalgo CreditAttribution: bryanhidalgo commentedSame problem here, Panels ignore string translation.
Comment #5
bibo CreditAttribution: bibo commented@merlinofchaos , that was a pretty good "guess", if you had no idea. Simply changing the style worked :)!
This whole issue is pretty weird, especially since views-blocks translations worked in panels with any style.
Marking as fixed.
Comment #7
sobi3ch CreditAttribution: sobi3ch commenteddon't work for me :(
but I noticed that panel dosn't change language variable
$node->language
so I've fix this by hook_nodeapi in panel.module file:Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm sorry, I don't quite get this. Can you explain in a little more detail what you did here? You added hook_nodeapi to page.module?
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedThis doesn't make any sense to me either. Worse, it's not really related to the original issue (Yes, both are about translation, but #7 is about panel nodes and the rest is about blocks).
Returning to previous state; if you wish to continue with this, please file a new issue. Also, you may need to be explicit in detailing what is wrong and how you think this fixes it. My gut feeling is that this is not right, and that core is supposed to be setting $node->language for us.
Comment #10
rougevert CreditAttribution: rougevert commentedHello Merlin, I got the same issue then #1 on my website, even not fully in the same logic : in my website, custom blocks defined as "translatable" and translated stay in default language while moving from one language to another. I try, as in #1 to put in in "english" to see then if it is possible to assign on block per language in my panel, but i got the same result : a block defined as "english" is still displayed whatever the language is set.
Comment #11
tinker CreditAttribution: tinker commentedHere are three possible solutions that are working for me. All of them assume you have i18n Internationalization module http://drupal.org/project/i18n installed and configured to provide content translation with PATH PREFIX or DOMAIN negotiation enabled.
Make sure panel content type is translatable.
Code block to detect language using PHP input. Need PHP knowledge to implement.
Comment #12
Arlina CreditAttribution: Arlina commentedSystem block style solved the issue for me. Thanks!
Comment #13
chlee CreditAttribution: chlee commentedFor me #11 step 2 worked out fine.
Thx for this post!
Comment #14
AaronBaumanSame issue for D7, but changing pane style to system block doesn't fix the issue.
I'm not sure that options from #11 apply - I can't find any multilingual settings for panels.
halp!
Comment #15
AaronBaumanI see now that comment #11 is referring to panel nodes.
I'm having trouble with regular old panels pages not respecting multilingual settings, which is what i thought the OP was about.
Comment #16
espurnesI tried #11 option 1, but no effect.
What I saw is that:
- The translation doesn't work if the block is assigned to a theme-region and you try to show it in a panel-region.
- The translation works if the block is not assigned to a theme-region.
Comment #17
pendaco CreditAttribution: pendaco commentedI'm running into the same problem as espurnes https://www.drupal.org/node/784648#comment-8244413
- Using the Block languages sub-module from i18n (1.11).
- Panels (3.4)
Using a block I added (title and body set to 'Make this block translatable') and translated to French. The block is added to one of the theme's regions.
When I use that same block in a panel page the block stays in English. As soon as I remove that block from the theme region it was in, the block on the panel page actually shows the correct French translation.
A work-around would be to duplicate that block for the time being, but a fix would be better :P If it's fixable by Panels though and not a core issue?
Comment #18
Jeffrey C. CreditAttribution: Jeffrey C. commentedMarking this as duplicate of #1168272: Drupal blocks are shown untranslated.