You are here

function lingotek_get_target_locales in Lingotek Translation 7.6

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.4 lingotek.util.inc \lingotek_get_target_locales()
  5. 7.5 lingotek.util.inc \lingotek_get_target_locales()

Get only the languages that are enabled

8 calls to lingotek_get_target_locales()
LingotekSync::getDownloadableReport in lib/Drupal/lingotek/LingotekSync.php
lingotek_enabled_langcode in ./lingotek.util.inc
lingotek_get_language_override_form in ./lingotek.module
Display the Lingotek language-override form field
lingotek_get_node_settings_form in ./lingotek.module
Display the Lingotek node-settings form
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.

... See full list

File

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

Code

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