You are here

function lingotek_delete_target_language in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_delete_target_language()
  2. 7.3 lingotek.util.inc \lingotek_delete_target_language()
  3. 7.4 lingotek.util.inc \lingotek_delete_target_language()
  4. 7.5 lingotek.util.inc \lingotek_delete_target_language()
  5. 7.6 lingotek.util.inc \lingotek_delete_target_language()

Flags a target language as active:FALSE in the Target Language tracking.

1 call to lingotek_delete_target_language()
lingotek_dashboard_command_ajax in ./lingotek.dashboard.inc
Ajax Command Processing for the Lingotek dashboard.

File

./lingotek.util.inc, line 672
Utility functions.

Code

function lingotek_delete_target_language($lingotek_locale) {
  $result = FALSE;
  if (is_string($lingotek_locale) && strlen($lingotek_locale)) {
    db_update('languages')
      ->fields(array(
      'lingotek_enabled' => 0,
    ))
      ->condition('lingotek_locale', $lingotek_locale)
      ->execute();
    watchdog("lingotek", "Target language removed: @lingotek_locale", array(
      '@lingotek_locale' => $lingotek_locale,
    ));

    // Removes the node sync target language entries from the lingotek table.
    lingotek_delete_target_sync_status_for_all_nodes($lingotek_locale);

    // Remove the Target Language from the Lingotek Project.
    $project_id = variable_get('lingotek_project', '');
    $api = LingotekApi::instance();
    $result = $api
      ->removeTranslationTarget(NULL, $project_id, $lingotek_locale);
  }
  return $result;
}