You are here

function _translation_table_row in Translation table 7

Same name and namespace in other branches
  1. 6 includes/admin.inc \_translation_table_row()

One row of the translation table.

Parameters

$source: source string record

$languages: languages to translate to

Return value

table row for theme_table

5 calls to _translation_table_row()
field_translation_table_filtered_form in modules/field.translation_table.inc
Form for field translation.
menu_translation_table_menu_filtered_form in modules/menu.translation_table.inc
Form for menu translation. Note: If the menu string is not in the locales_source table, then it won't be displayed.
node_translation_table_nodetype_filtered_form in modules/node.translation_table.inc
Form for node type translation. Note: If the node type is not in the locales_source table, then it won't be displayed.
quicktabs_translation_table_quicktabs_filtered_form in modules/quicktabs.translation_table.inc
Form for quicktabs translation.
taxonomy_translation_table_taxonomy_filtered_form in modules/taxonomy.translation_table.inc
Form for taxonomy translation. Note: If term and vocabulary strings are not in the locales_source table, then they won't be displayed.

File

includes/admin.inc, line 40
The administration interface.

Code

function _translation_table_row($source, $languages) {
  $form['source'] = array(
    '#markup' => check_plain($source->source),
  );
  $form['location'] = array(
    '#type' => 'value',
    '#value' => check_plain($source->location),
  );
  foreach ($languages as $lang_code => $lang_name) {
    $translation = db_query("SELECT lt.translation FROM {locales_target} lt WHERE lt.lid = :lid AND lt.language = :lang", array(
      'lid' => $source->lid,
      'lang' => $lang_code,
    ))
      ->fetchField();
    $form[$lang_code] = array(
      '#type' => 'textfield',
      '#default_value' => $translation,
      '#size' => 35,
      '#maxlength' => NULL,
    );
  }
  return $form;
}