You are here

function lingotek_get_target_locales in Lingotek Translation 7.3

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

Get only the languages that are lingotek_enabled

1 call to lingotek_get_target_locales()
lingotek_get_sync_download_batch_elements in ./lingotek.batch.inc
Sync - Download Batch Elements: Creates the batch elements for nodes/documents that need to be downloaded.

File

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

Code

function lingotek_get_target_locales($codes_only = TRUE) {
  $target_languages = db_query("SELECT * FROM {languages} WHERE lingotek_enabled = :lingotek_enabled", array(
    ':lingotek_enabled' => 1,
  ))
    ->fetchAll();
  $target_codes = array();
  foreach ($target_languages as $target_language) {
    $target_codes[] = $target_language->lingotek_locale;
  }
  return $codes_only ? $target_codes : $target_languages;
}