You are here

function globallink_get_locale_code in GlobalLink Connect for Drupal 7.6

Same name and namespace in other branches
  1. 7.7 globallink.inc \globallink_get_locale_code()
  2. 7.5 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.

15 calls to globallink_get_locale_code()
get_tpt_entity_sent_rows in globallink_entity/globallink_entity.module
Gets entity rows that have been sent for translation.
globallink_beans_dashboard_form in globallink_beans/globallink_beans_send.inc
Builds form to create a beans submission.
globallink_block_dashboard_form in globallink_block/globallink_block_send.inc
Builds form to create a block submission.
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.

... See full list

File

./globallink.inc, line 404
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;
}