diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index c4ff11f78ed436ac55a42b95c79bdc544cf76500..9819f182b22675e77ae820b4d062505c684a9f70 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -246,7 +246,7 @@ function locale_theme() { 'template' => 'locale-translation-last-check', ), 'locale_translation_update_info' => array( - 'arguments' => array('updates' => array(), 'not_found' => array()), + 'variables' => array('updates' => array(), 'not_found' => array()), 'file' => 'locale.pages.inc', 'template' => 'locale-translation-update-info', ), diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 83777b67c1535162d6d7ccabf566b02d68247170..15fefb6d91fbd1086f533a71ad8c0ee69204291d 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -520,9 +520,15 @@ function locale_translation_status_form($form, &$form_state) { // Build data options for the select table. foreach($updates as $langcode => $update) { + $locale_translation_update_info = array('#theme' => 'locale_translation_update_info'); + foreach (array('updates', 'not_found') as $update_status) { + if (isset($update[$update_status])) { + $locale_translation_update_info['#' . $update_status] = $update[$update_status]; + } + } $options[$langcode] = array( 'title' => check_plain($languages[$langcode]->name), - 'status' => array('class' => array('description', 'expand', 'priority-low'), 'data' => theme('locale_translation_update_info', $update)), + 'status' => array('class' => array('description', 'expand', 'priority-low'), 'data' => drupal_render($locale_translation_update_info)), ); } // Sort the table data on language name. @@ -718,13 +724,16 @@ function theme_locale_translate_edit_form_strings($variables) { array('data' => $string['translations']), ); } - $output .= theme('table', array( - 'header' => $header, - 'rows' => $rows, - 'empty' => t('No strings available.'), - 'attributes' => array('class' => array('locale-translate-edit-table')), - )); - $output .= theme('pager'); + $table = array( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#empty' => t('No strings available.'), + '#attributes' => array('class' => array('locale-translate-edit-table')), + ); + $output .= drupal_render($table); + $pager = array('#theme' => 'pager'); + $output .= drupal_render($pager); return $output; } @@ -747,8 +756,8 @@ function template_preprocess_locale_translation_update_info(&$variables) { // Build output for available updates. if (isset($variables['updates'])) { + $releases = array(); if ($variables['updates']) { - $releases = array(); foreach ($variables['updates'] as $update) { $modules[] = $update['name']; $releases[] = t('@module (@date)', array('@module' => $update['name'], '@date' => format_date($update['timestamp'], 'html_date'))); @@ -763,9 +772,9 @@ function template_preprocess_locale_translation_update_info(&$variables) { // Build output for updates not found. if (isset($variables['not_found'])) { + $releases = array(); $variables['missing_updates_status'] = format_plural(count($variables['not_found']), 'Missing translations for one project', 'Missing translations for @count projects'); if ($variables['not_found']) { - $releases = array(); foreach ($variables['not_found'] as $update) { $version = $update['version'] ? $update['version'] : t('no version'); $releases[] = t('@module (@version).', array('@module' => $update['name'], '@version' => $version)) . ' ' . $update['info'];