You are here

function lingotek_setup_language_settings_form in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lingotek.setup.inc \lingotek_setup_language_settings_form()
  2. 7.4 lingotek.setup.inc \lingotek_setup_language_settings_form()

Language Selection - Form Layout

1 string reference to 'lingotek_setup_language_settings_form'
lingotek_menu in ./lingotek.module
Implements hook_menu().

File

./lingotek.setup.inc, line 566

Code

function lingotek_setup_language_settings_form() {
  $languages = array(
    '0' => t('Select a Language...'),
    'ar' => t('Arabic'),
    'zh-hans' => t('Chinese (Simplified)'),
    'nl' => t('Dutch'),
    'en' => t('English'),
    'fr' => t('French'),
    'de' => t('German'),
    'it' => t('Italian'),
    'ja' => t('Japanese'),
    'ko' => t('Korean'),
    'pt-br' => t('Portuguese'),
    'ru' => t('Russian'),
    'es' => t('Spanish'),
  );
  $default_language = language_default();
  $source_language = variable_get('lingotek_source_language', $default_language->language);
  $form['lingotek_current_language'] = array(
    '#type' => 'item',
    '#title' => t('Source language'),
    '#description' => t('To get started, select the source language that the website is written in.'),
  );
  $form['lingotek_install_source_language'] = array(
    //'#title' => t('Source Language'),
    '#type' => 'select',
    '#options' => $languages,
    '#default_value' => $source_language,
    '#description' => t('<br/>In most cases, your source language should be the default language. (The current site default language is: <b>' . $default_language->name . '</b>)'),
    //t('The current language your site is written in.'),
    '#required' => TRUE,
  );
  $form['lingotek_button_spacer'] = array(
    '#markup' => '<div>&nbsp;</div>',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
  );
  if (is_array($_SESSION['lingotek_setup_path'])) {
    if (end($_SESSION['lingotek_setup_path']) == 'admin/config/lingotek/language-settings') {
      $null = array_pop($_SESSION['lingotek_setup_path']);
    }

    // if the user went back, remove the last element, which is this page.
    $form['lingotek_back_button'] = lingotek_setup_link(end($_SESSION['lingotek_setup_path']), t('Previous Step'));
  }
  $form['lingotek_support_footer'] = lingotek_support_footer();
  return $form;
}