You are here

function views_plugin_localization_core::export_render in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 7.3 plugins/views_plugin_localization_core.inc \views_plugin_localization_core::export_render()

Render any collected exported strings to code.

Parameters

$indent: An optional indentation for prettifying nested code.

Overrides views_plugin_localization::export_render

File

plugins/views_plugin_localization_core.inc, line 97
Contains the Drupal core localization plugin.

Class

views_plugin_localization_core
Localization plugin to pass translatable strings through t().

Code

function export_render($indent = '  ') {
  $output = '';
  if (!empty($this->export_strings)) {
    $this->export_strings = array_unique($this->export_strings);
    $output = $indent . '$translatables[\'' . $this->view->name . '\'] = array(' . "\n";
    foreach ($this->export_strings as $string) {
      $output .= $indent . "  t('" . str_replace("'", "\\'", $string) . "'),\n";
    }
    $output .= $indent . ");\n";
  }
  return $output;
}