You are here

function lingotek_setup_language_settings_form in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.3 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 505
Lingotek Easy Install Process.

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_1'] = array(
    '#markup' => '<p>To get started, select the source language of your website.</p>',
  );
  $form['lingotek_current_language_2'] = array(
    '#markup' => '<p>The current site default language is: ' . $default_language->name . ' ( ' . $default_language->language . ' )</p>',
  );
  $form['lingotek_current_language_3'] = array(
    '#markup' => '<p>In most cases, your source language should be the default language.</p>',
  );
  $form['lingotek_install_source_language'] = array(
    '#title' => t('Source Language'),
    '#type' => 'select',
    '#options' => $languages,
    '#default_value' => $source_language,
    '#description' => 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;
}