You are here

function globallink_get_drupal_locales in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_get_drupal_locales()
  2. 7.6 globallink.inc \globallink_get_drupal_locales()

Gets enabled Drupal locales.

Return value

array Array of enabled Drupal locales.

File

./globallink.inc, line 958
Miscellaneous GlobalLink functions for node translations (non-entity).

Code

function globallink_get_drupal_locales() {
  $languages = array();
  $result = db_select('languages', 'l')
    ->fields('l')
    ->condition('enabled', '1', '=')
    ->execute();
  foreach ($result as $row) {
    $languages[$row->language] = $row->name;
  }
  return $languages;
}