Comments

Syd Barrett’s picture

wiliam_steven’s picture

I also have troubling in this translation, the multi block not working and not displaying anything.

TWD’s picture

Still a problem for any blocks with custom content.

If I create a new instance of such a block and click on "Translate" it only gives me the block Title field, the Body field is not shown.

tramm’s picture

I have to same problem as described in #3.

Jorge Navarro’s picture

Issue summary: View changes

Same problem. Subscribing.

aye mon’s picture

I also have problem as #3.

neddstark’s picture

you have to translate the original block, then you need to patch the module so the multi block instance will render the translation:

after line 106:
$block = module_invoke($block_info->module, 'block_'. $op, $block_info->orig_delta);

add the following line:
$block['content'] = i18n_string(array('blocks', 'block', $block_info->orig_delta, 'body'), $block['content']);

This will take care to render the proper language content.

Jorge Navarro’s picture

@neddstark After adding the line I get some errors and blocks disappear:

Notice: Uninitialized string offset: 0 in drupal_pre_render_link() (line 5619 of /includes/common.inc).
Recoverable fatal error: Argument 3 passed to l() must be an array, string given, called in /includes/common.inc on line 5640 and defined in l() (line 2458 of /includes/common.inc).

Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1583 of /includes/bootstrap.inc).
neddstark’s picture

@Jorge Navarro
did you activated the translation for original block, and translated it? the instance should display the translation afterwards.

intrafusion’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs work

@neddstark Please could you review the recent changes and supply a patch which can be tested, etc.

mstiem’s picture

Issue summary: View changes
StatusFileSize
new641 bytes

Hi,

because I went in the same issue, and could get a good result by adding this line code from comment #7 I created a patch. I hope that helps. Good for me so far

mstiem’s picture

Issue summary: View changes
StatusFileSize
new720 bytes

Hi,
after closer look to the default settings... and to prevent a fatal error if "i18n" not enabled.Here is a new patch which covers the normal case with no i18n.

mstiem’s picture

Status: Needs work » Needs review

patch created for the multilingual i18n translations

intrafusion’s picture

Status: Needs review » Fixed

Thanks for your assistance, your patch has been committed.

  • intrafusion committed 67cac9f on 7.x-1.x authored by mstiem
    Issue #1319402 by mstiem: Can't make multiblock instance translatable
    

Status: Fixed » Closed (fixed)

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

intrafusion’s picture

  • intrafusion committed d108511 on 7.x-1.x
    Revert "Issue #1319402 by mstiem: Can't make multiblock instance...
gravisrs’s picture

In #12

We should translate only blocks, that are from module block (as other modules should handle translations in their own way, and to avoid running i18n_string on html output from other blocks), am I right ?

So in patch at that line:

+ if (module_exists('i18n')) {

I think we should use

+ if (module_exists('i18n') && $block['orig_module'] == 'block') {