function theme_locale_translate_edit_form_strings

Returns HTML for translation edit form.

Parameters

array $variables: An associative array containing:

  • form: The form that contains the language information.

See also

locale_translate_edit_form()

Related topics

1 theme call to theme_locale_translate_edit_form_strings()
locale_translate_edit_form in drupal/core/modules/locale/locale.pages.inc
Form constructor for the string editing form.

File

drupal/core/modules/locale/locale.pages.inc, line 706
Interface translation summary, editing and deletion user interfaces.

Code

function theme_locale_translate_edit_form_strings($variables) {
  $output = '';
  $form = $variables['form'];
  $header = array(
    t('Source string'),
    t('Translation for @language', array(
      '@language' => $form['#language'],
    )),
  );
  $rows = array();
  foreach (element_children($form) as $lid) {
    $string = $form[$lid];
    if ($string['plural']['#value']) {
      $source = drupal_render($string['original_singular']) . '<br />' . drupal_render($string['original_plural']);
    }
    else {
      $source = drupal_render($string['original']);
    }
    $source .= empty($string['context']) ? '' : '<br /><small>' . t('In Context') . ':&nbsp;' . $string['context']['#value'] . '</small>';
    $rows[] = array(
      array(
        'data' => $source,
      ),
      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');
  return $output;
}