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.
Context won't show translated blocks in any language but the default. I would assume the default behavior to match the block-language of the node in context. Any ideas?
Comments
Comment #1
kant CreditAttribution: kant commentedI have the same problem. When I add a translated block in an area via context, the block is only displayed in the default language.
If I put this block in the same area with the block module instead, the block is being translated.
I tried to change the context module weight so that it is heavier than the "i18n_block" module, but the block was still not translated.
Thanks for your help!
Comment #2
webflo CreditAttribution: webflo commentedTagging.
Comment #3
webflo CreditAttribution: webflo commentedI've tried to fix this incompatibility with
hook_context_block_info_alter().
. This was not sufficient. Changes of hook_context_block_info_alter() are not passed to_block_render_blocks
.Related issue in i18n issue queue: #1343044: Context and block translation.
Comment #4
webflo CreditAttribution: webflo commentedComment #5
tekante CreditAttribution: tekante commentedI tried using the patch from #3 and it did not appear to resolve the issue. I believe the longer term solution may lie with ensuring that context allows blocks to be altered when viewed (a related issue #1251240: Context block reaction lists blocks without calling hook_block_info_alter().) though installing the patch present in the #2 comment there did not resolve this issue either. Looking at that patch it is only exposing the block for an alter on hook_block_info.
To set up for this review I installed i18n, variable and enabled the context modules along with i18n_block after a standard install. Configured to allow an alternate language (French) and created both a test article which I would adjust the language on as well as a test block with a translation. When viewing the site in an alternate language using a language element from the path I could see the block changing languages when placed via the block interface but not when placed via the context block reaction.
Comment #6
webflo CreditAttribution: webflo commentedYou need the patch from #1343044: Context and block translation. too.
Comment #7
kant CreditAttribution: kant commentedIndeed, patch #3 works, in combination with the patch referenced in #6.
Thanks a lot, webflo!
Comment #8
valderama CreditAttribution: valderama commentedworks nicely, thanks a lot!
Comment #9
NnekaThanks for this patch. Works nicely. :)
Comment #10
gagarine CreditAttribution: gagarine commentedComment #11
mordek CreditAttribution: mordek commentedWorking nicely :)
Comment #12
mmncs CreditAttribution: mmncs commentedThanks webflo, works!
Comment #13
codi CreditAttribution: codi commentedConfirmed working in i18n 7.x-1.4 (2012-Feb-05) and context 7.x-3.0-beta2 (2011-Sep-08) with the patch from this issue (comment #3) and http://drupal.org/node/1343044#comment-5249924
Comment #14
wwhurley CreditAttribution: wwhurley commentedConfirmed to be working with with the patch to i18n in http://drupal.org/node/1343044#comment-5249924. Thanks.
Comment #15
setvik CreditAttribution: setvik commentedConfirmed working here as well. Would be great to get this committed.
Comment #16
tekante CreditAttribution: tekante commentedCommitted: http://drupalcode.org/project/context.git/commit/ef56618ce88949ddeccee2c... thanks for the bug report and the patch
Comment #17
webflo CreditAttribution: webflo commentedAwesome. Thanks!
Comment #18
stano.lacko CreditAttribution: stano.lacko commentedI have installed current dev 2012-Feb-20 with last i18n (7.x-1.4) and it's not working.
When block is showed from admin/structure/block, then is in "domain/en" version showed english version and in "domain/sk" version slovak version.
When is block showed by context, always is showed original slovak version of block.
Comment #19
tekante CreditAttribution: tekante commentedstano.lacko - i18n 7.x-1.4 needs the patch in the issue pointed at in comment 14 (or use of the dev version) for this commit to work.
Comment #21
GoZ CreditAttribution: GoZ commentedI use Context 7.x-3.0-beta6 and i18n 7.x-1.7.
With i18n_block enabled, I can define 1 or more languages for a block. So if I check english to a block, it shouldn't be displayed on french, deutch or other language.
Unfortunatelly, previous patch only take care of "translatable" option, and not localization.
I join patch to make it possible. This have to be used with patch of this issue http://drupal.org/node/1343044 on comment #9
Comment #22
dooug CreditAttribution: dooug commentedThis patch wouldn't apply and was malformed for some reason. I applied it manually and re-rolled the patch. Works for me! Thanks.
Comment #23
upupax CreditAttribution: upupax commentedI have tried to patch Context 7.x-3.0-beta6 with patch #22, but nothing happened.
Comment #24
dooug CreditAttribution: dooug commentedPlease clarify "nothing Happened"? Are you testing with language specific blocks in contexts?
Did you apply the patch to the i18n?
Comment #25
upupax CreditAttribution: upupax commentedI have applied the patch to l18n-7.x-1.8 and patch #23 to Context 7.x-3.0-beta6.
I have translated block A from italian to english (block B)
I have a context where block A is shown.
Switching from italian to english, no block is shown.
I guess I should see block B instead.
Comment #26
upupax CreditAttribution: upupax commentedSorry, the patch works great.
I was not considering that my context was path based.
Comment #27
dooug CreditAttribution: dooug commentedComment #28
tekante CreditAttribution: tekante commentedAttaching reroll of patch against latest context version. This patch in context requires this patch https://drupal.org/node/1343044#comment-7003152 in i18n to work. Since that issue is still under discussion I'm going to hold on applying this patch to context to see the resolution there. Also downgrading status as this appears to have a few other potential implementations.
Comment #29
colanLooks like we're waiting for #1343044: Context and block translation..
Comment #30
kristiaanvandeneyndeYup, just set that issue to RTBC. Fingers crossed.