1 views_plugin_localization.inc public views_plugin_localization::process_locale_strings($op)

Process strings.

Parameters

string $op: Operation name, "save" or "delete".

File

core/modules/views/plugins/views_plugin_localization.inc, line 135
Definition of views_plugin_localization.

Class

views_plugin_localization
The base plugin to handle localization of Views strings.

Code

public function process_locale_strings($op) {
  $this->view->init_display();

  foreach ($this->view->display as $display_id => $display) {
    $translatable = array();
    // Special handling for display title.
    if (isset($display->display_title)) {
      $translatable[] = array('value' => $display->display_title, 'keys' => array('display_title'));
    }
    // Unpack handlers.
    if (is_object($this->view->display[$display_id]->handler)) {
      $this->view->display[$display_id]->handler->unpack_translatables($translatable);
    }
    foreach ($translatable as $data) {
      $data['keys'] = array_merge(array($this->view->name, $display_id), $data['keys']);
      switch ($op) {
        case 'save':
          $this->save($data);
          break;

        case 'delete':
          $this->delete($data);
          break;

      }
    }
  }
}