diff --git a/panels.module b/panels.module index b312033..5233d7a 100644 --- a/panels.module +++ b/panels.module @@ -882,6 +882,11 @@ function panels_save_display(&$display) { $update = (isset($display->did) && is_numeric($display->did)) ? array('did') : array(); drupal_write_record('panels_display', $display, $update); + // Mark the title translation as outdated. + if (function_exists('i18n_string')) { + i18n_string("panels:display:$display->did:title", $display->title, array('update' => TRUE)); + } + $pids = array(); if ($update) { // Get a list of all panes currently in the database for this display so we can know if there @@ -980,6 +985,11 @@ function panels_delete_display($display) { } db_delete('panels_display')->condition('did', $did)->execute(); db_delete('panels_pane')->condition('did', $did)->execute(); + + // Remove the title from the translation tables. + if (function_exists('i18n_string_remove')) { + i18n_string_remove("panels:display:$did:title"); + } } /** @@ -1064,6 +1074,11 @@ function panels_export_display($display, $prefix = '') { * @ingroup hook_invocations */ function panels_render_display(&$display, $renderer = NULL) { + // Translate the title if necessary. + if (function_exists('i18n_string')) { + $display->title = i18n_string("panels:display:$display->did:title", $display->title); + } + ctools_include('plugins', 'panels'); ctools_include('context'); @@ -1756,3 +1771,13 @@ function panels_preprocess_html(&$vars) { $vars['classes_array'][] = check_plain($panel_body_css['body_classes_to_add']); } } + +/** + * Implements hook_locale(); + */ +function panels_locale($op = 'groups') { + switch ($op) { + case 'groups': + return array('panels' => t('Panels')); + } +}