You are here

function lingotek_update in Lingotek Translation 6

Same name and namespace in other branches
  1. 7.2 lingotek.page.inc \lingotek_update()
1 string reference to 'lingotek_update'
lingotek_menu in ./lingotek.module

File

./lingotek.page.inc, line 216
Displays progress of the community translation

Code

function lingotek_update($nid) {
  global $_lingotek_locale;
  $node = node_load(array(
    'nid' => $nid,
  ));
  foreach ($_POST['targets'] as $target) {

    //Handle the language being passed as the value lingotek uses already:
    if (!array_key_exists($target, $_lingotek_locale)) {
      $target = lingotek_drupal_language($target);
    }
    lingotek_download_document($node, lingotek_get_node($target, $nid));
  }
  drupal_json(array(
    'status' => 0,
    'updated' => $_POST['targets'],
    'nid' => $nid,
  ));
}