You are here

function _locale_admin_export_screen in Drupal 4

Same name and namespace in other branches
  1. 5 includes/locale.inc \_locale_admin_export_screen()

User interface for the translation export screen

1 call to _locale_admin_export_screen()
locale_admin_export in modules/locale.module
Page handler for the translation export screen

File

includes/locale.inc, line 272
Admin-related functions for locale.module.

Code

function _locale_admin_export_screen() {
  $languages = locale_supported_languages(FALSE, TRUE);
  $languages = array_map('t', $languages['name']);
  unset($languages['en']);

  // Offer language specific export if any language is set up
  if (count($languages)) {
    $form = array();
    $form['export'] = array(
      '#type' => 'fieldset',
      '#title' => t('Export translation'),
      '#collapsible' => TRUE,
    );
    $form['export']['langcode'] = array(
      '#type' => 'select',
      '#title' => t('Language name'),
      '#options' => $languages,
      '#description' => t('Select the language you would like to export in gettext Portable Object (.po) format.'),
    );
    $form['export']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Export'),
    );
    $output = drupal_get_form('_locale_export_po', $form);
  }

  // Complete template export of the strings
  $form = array();
  $form['export'] = array(
    '#type' => 'fieldset',
    '#title' => t('Export template'),
    '#collapsible' => TRUE,
    '#description' => t('Generate a gettext Portable Object Template (.pot) file with all the interface strings from the Drupal locale database.'),
  );
  $form['export']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Export'),
  );
  $output .= drupal_get_form('_locale_export_pot', $form, '_locale_export_po');
  return $output;
}