commit 03a5b8a4308749acf39510f6d41223f32919b16a Author: Shane Auckland Date: Fri Apr 12 07:15:11 2013 +0100 1898428-new_changes diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index cd4d98d..2536f2c 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -259,7 +259,6 @@ function locale_theme() { 'locale_translate_edit_form_strings' => array( 'render element' => 'form', 'file' => 'locale.pages.inc', - 'template' => 'locale-translate-edit-form-strings', ), 'locale_translation_last_check' => array( 'variables' => array('last' => NULL), diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index e8f7800..c879ab7 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -693,17 +693,17 @@ function _locale_translation_status_debug_info($source) { } /** - * Prepares variables for translation edit form. - * - * Default template: locale-translate-edit-form-strings.html.twig. + * Returns HTML for translation edit form. * * @param array $variables * An associative array containing: * - form: The form that contains the language information. * * @see locale_translate_edit_form() + * @ingroup themeable */ -function template_preprocess_locale_translate_edit_form_strings(&$variables) { +function theme_locale_translate_edit_form_strings($variables) { + $output = ''; $form = $variables['form']; $header = array( t('Source string'), @@ -724,14 +724,14 @@ function template_preprocess_locale_translate_edit_form_strings(&$variables) { array('data' => $string['translations']), ); } - $variables['table'] = array( - '#theme' => 'table', - '#header' => $header, - '#rows' => $rows, - '#empty' => t('No strings available.'), - '#attributes' => array('class' => array('locale-translate-edit-table')), - ); - $variables['pager'] = array('#theme' => 'pager'); + $output .= theme('table', array( + 'header' => $header, + 'rows' => $rows, + 'empty' => t('No strings available.'), + 'attributes' => array('class' => array('locale-translate-edit-table')), + )); + $output .= theme('pager'); + return $output; } /** @@ -747,7 +747,6 @@ function template_preprocess_locale_translate_edit_form_strings(&$variables) { * @see locale_translation_status_form() */ function template_preprocess_locale_translation_update_info(&$variables) { - $description = ''; $details = array(); // Build output for available updates. @@ -758,8 +757,8 @@ function template_preprocess_locale_translation_update_info(&$variables) { $modules[] = $update['name']; $releases[] = t('@module (@date)', array('@module' => $update['name'], '@date' => format_date($update['timestamp'], 'html_date'))); } + $variables['modules'] = $modules; } - $description = t('Updates for: @modules', array('@modules' => implode(', ', $modules))); $details['available_updates_list'] = array( '#theme' => 'item_list', '#items' => $releases, @@ -768,9 +767,7 @@ function template_preprocess_locale_translation_update_info(&$variables) { // Build output for updates not found. if (isset($variables['not_found'])) { - if (empty($description)) { - $description = format_plural(count($variables['not_found']), 'Missing translations for one project', 'Missing translations for @count projects'); - } + $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) { @@ -782,12 +779,12 @@ function template_preprocess_locale_translation_update_info(&$variables) { '#theme' => 'item_list', '#items' => $releases, ); - // Prefix the missing updates list if there is an available updates lists before it. + // Prefix the missing updates list if there is an available updates lists + // before it. if (!empty($details['available_updates_list']['#items'])) { $details['missing_updates_list']['#prefix'] = t('Missing translations for:'); } } - $variables['description'] = $description; $variables['details'] = $details; } diff --git a/core/modules/locale/templates/locale-translate-edit-form-strings.html.twig b/core/modules/locale/templates/locale-translate-edit-form-strings.html.twig deleted file mode 100644 index 5e4cf15..0000000 --- a/core/modules/locale/templates/locale-translate-edit-form-strings.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{# -/** - * @file - * Default theme implementation for the translation edit form. - * - * Available variables: - * - table: form table of translatable strings. - * - pager: The pager next/prev links to display, if any. - * - * @see template_preprocess() - * @see template_preprocess_locale_translate_edit_form_strings() - * - * @ingroup themeable - */ -#} -{{ table }} -{{ pager }} diff --git a/core/modules/locale/templates/locale-translation-last-check.html.twig b/core/modules/locale/templates/locale-translation-last-check.html.twig index 47f9040..f11a2b1 100644 --- a/core/modules/locale/templates/locale-translation-last-check.html.twig +++ b/core/modules/locale/templates/locale-translation-last-check.html.twig @@ -5,7 +5,8 @@ * * Available variables: * - last_checked: Whether or not the time has been checked before. - * - time: The formatted time ago when the site last checked for available updates. + * - time: The formatted time ago when the site last checked for available + * updates. * - link: A link to manually check available updates. * * @see template_preprocess() diff --git a/core/modules/locale/templates/locale-translation-update-info.html.twig b/core/modules/locale/templates/locale-translation-update-info.html.twig index 28c2a3f..c5228e7 100644 --- a/core/modules/locale/templates/locale-translation-update-info.html.twig +++ b/core/modules/locale/templates/locale-translation-update-info.html.twig @@ -1,7 +1,9 @@ {# /** * @file - * Default theme implementation for the translation status information per language. + * Default theme implementation for displaying translation status information. + * + * Displays translation status information per language. * * Available variables: * - description: A description of the translation's update status. @@ -15,8 +17,10 @@ #}
Show description - {% if description %} - {{ description }} + {% if modules %} + {{ 'Updates for'|t }}: {{ modules|join(', ') }} + {% elsif missing_updates_status %} + {{ missing_updates_status }} {% endif %} {% if details %}
{{ details }}