You are here

function i18n_string_translate_page_form_base in Internationalization 7

Create base form for string translation

1 call to i18n_string_translate_page_form_base()
i18n_string_translate_page_form in i18n_string/i18n_string.pages.inc
Form builder callback for in-place string translation.

File

i18n_string/i18n_string.pages.inc, line 151
Internationalization (i18n) package - translatable strings reusable admin UI.

Code

function i18n_string_translate_page_form_base($form, $langcode, $redirect = NULL) {
  $form['langcode'] = array(
    '#type' => 'value',
    '#value' => $langcode,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save translation'),
    '#weight' => 10,
  );
  if ($redirect) {
    $form['#redirect'] = array(
      $redirect,
    );
  }

  // Add explicit validate and submit hooks so this can be used from inside any form.
  $form['#submit'] = array(
    'i18n_string_translate_page_form_submit',
  );
  return $form;
}