You are here

function i18n_block_translate_block in Internationalization 7

Translate block.

Parameters

$block: Core block object

File

i18n_block/i18n_block.module, line 346
Internationalization (i18n) submodule: Multilingual meta-blocks

Code

function i18n_block_translate_block($block) {
  if (!empty($block->content) && $localizable) {
    $block->content = i18n_string_text("blocks:{$block->module}:{$block->delta}:body", $block->content);
  }

  // If it has a custom title, localize it
  if (!empty($block->title) && $block->title != '<none>') {

    // Check plain here to allow module generated titles to keep any markup.
    $block->subject = i18n_string_plain("blocks:{$block->module}:{$block->delta}:title", $block->subject);
  }
  return $block;
}