You are here

function globallink_get_locale_code in GlobalLink Connect for Drupal 7.7

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

Gets GlobalLink locale code.

Parameters

string $drupal_locale: The Drupal locale code.

Return value

string The GlobalLink locale code.

5 calls to globallink_get_locale_code()
globallink_create_submission_form in ./globallink_send_translations.inc
globallink_dashboard_node_form in ./globallink_send_translations.inc
Builds form to create a GlobalLink submission.
globallink_entity_dashboard_form in globallink_entity/globallink_entity_send.inc
Builds form to create an entity submission.
globallink_update_change_detection in ./globallink.module
Update row to flag that node has been modified.
globallink_update_change_detection_entity in globallink_entity/globallink_entity.module
Updates change detection entity with new node ID and language.

File

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

Code

function globallink_get_locale_code($drupal_locale) {
  $result = db_select('globallink_locale', 'tl')
    ->fields('tl')
    ->condition('drupal_locale_code', $drupal_locale, '=')
    ->execute();
  $locale_code = '';
  foreach ($result as $row) {
    $locale_code = $row->locale_code;
  }
  return $locale_code;
}