You are here

function lingotek_get_target_locales in Lingotek Translation 7.4

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.3 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 enabled

3 calls to lingotek_get_target_locales()
LingotekSync::getDownloadableReport in lib/Drupal/lingotek/LingotekSync.php
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.
lingotek_grid_action_submit in ./lingotek.bulk_grid.inc
Submit function for The Grid's actions The action corresponds to the key of the option selected Often redirects to batch operations or to other pages entirely

File

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

Code

function lingotek_get_target_locales($codes_only = TRUE) {
  $target_languages = db_query("SELECT * FROM {languages} WHERE enabled = :enabled", array(
    ':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;
}