You are here

function i18n_panels_panels_pre_render in Panels 7.3

Implements hook_panels_pre_render().

This function must not rely on the passed $renderer parameter. The parameter could be empty because this function is reused in i18n_ctools_render_alter().

@todo Check if a drupal_alter() in panels_display::get_title() is applicable.

Parameters

panels_display $display: The display to deal with.

panels_renderer_standard $renderer: The renderer to deal with.

See also

i18n_ctools_render_alter()

1 call to i18n_panels_panels_pre_render()
i18n_ctools_render_alter in i18n_panels/i18n_panels.module
Implements hook_ctools_render_alter().

File

i18n_panels/i18n_panels.module, line 219
Internationalization (i18n) submodule: Panels translation.

Code

function i18n_panels_panels_pre_render(&$display, $renderer) {

  // Avoid double translations.
  if (!isset($display->i18n_panels_title_translated)) {
    $translation = i18n_string_object_translate('display_configuration', $display);
    if (is_array($translation->title)) {
      $display->title = $translation->title['string'];
    }
    else {
      $display->title = $translation->title;
    }
    $display->i18n_panels_title_translated = TRUE;
  }
}