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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kant’s picture

I 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!

webflo’s picture

Issue tags: +i18n compatibility

Tagging.

webflo’s picture

FileSize
1.49 KB

I'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.

webflo’s picture

Status: Active » Needs review
tekante’s picture

I 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.

webflo’s picture

You need the patch from #1343044: Context and block translation. too.

kant’s picture

Indeed, patch #3 works, in combination with the patch referenced in #6.

Thanks a lot, webflo!

valderama’s picture

works nicely, thanks a lot!

Nneka’s picture

Thanks for this patch. Works nicely. :)

gagarine’s picture

Status: Needs review » Reviewed & tested by the community
mordek’s picture

Working nicely :)

mmncs’s picture

Thanks webflo, works!

codi’s picture

Confirmed 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

wwhurley’s picture

Confirmed to be working with with the patch to i18n in http://drupal.org/node/1343044#comment-5249924. Thanks.

setvik’s picture

Confirmed working here as well. Would be great to get this committed.

tekante’s picture

Status: Reviewed & tested by the community » Fixed

Committed: http://drupalcode.org/project/context.git/commit/ef56618ce88949ddeccee2c... thanks for the bug report and the patch

webflo’s picture

Awesome. Thanks!

stano.lacko’s picture

Status: Fixed » Needs work

I 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.

tekante’s picture

Status: Needs work » Fixed

stano.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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

GoZ’s picture

Version: 7.x-3.x-dev » 7.x-3.0-beta6
Status: Closed (fixed) » Needs review
FileSize
2.12 KB

I 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

dooug’s picture

This patch wouldn't apply and was malformed for some reason. I applied it manually and re-rolled the patch. Works for me! Thanks.

upupax’s picture

I have tried to patch Context 7.x-3.0-beta6 with patch #22, but nothing happened.

dooug’s picture

Please clarify "nothing Happened"? Are you testing with language specific blocks in contexts?

Did you apply the patch to the i18n?

This patch must be used with patch of this issue http://drupal.org/node/1343044 on comment #9

upupax’s picture

I 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.

upupax’s picture

Sorry, the patch works great.
I was not considering that my context was path based.

dooug’s picture

Status: Needs review » Reviewed & tested by the community
tekante’s picture

Priority: Critical » Normal
FileSize
1.75 KB

Attaching 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.

colan’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Looks like we're waiting for #1343044: Context and block translation..

kristiaanvandeneynde’s picture

Yup, just set that issue to RTBC. Fingers crossed.

  • tekante committed ef56618 on 8.x-4.x authored by webflo
    Issue #1320864 by oskarrough and webflo: Context not respecting block...

  • tekante committed ef56618 on 8.x-0.x authored by webflo
    Issue #1320864 by oskarrough and webflo: Context not respecting block...

  • tekante committed ef56618 on 8.x-1.x authored by webflo
    Issue #1320864 by oskarrough and webflo: Context not respecting block...