You are here

function lingotek_get_target_locales in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lingotek.util.inc \lingotek_get_target_locales()
  2. 7.3 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 enabled

13 calls to lingotek_get_target_locales()
LingotekSync::getDownloadableReport in lib/Drupal/lingotek/LingotekSync.php
lingotek_admin_entity_bundle_profiles_form in ./lingotek.admin.inc
Content translation form
lingotek_admin_profile_form in ./lingotek.admin.inc
Content defaults Form
lingotek_admin_profile_form_submit in ./lingotek.admin.inc
lingotek_batch_update_entity_languages_by_profile in ./lingotek.batch.inc

... See full list

File

./lingotek.util.inc, line 1433
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;
}