You are here

function apdqc_get_lang in Asynchronous Prefetch Database Query Cache 7

Returns the language shorthand escaped for database use.

Return value

string Shorthand for the given language.

9 calls to apdqc_get_lang()
apdqc_boot in ./apdqc.module
Implements hook_boot().
apdqc_ctools_plugin_pre_alter in ./apdqc.module
Implements hook_ctools_plugin_pre_alter().
apdqc_init in ./apdqc.module
Implements hook_init().
apdqc_menu_get_item_alter in ./apdqc.module
Implements hook_menu_get_item_alter().
apdqc_stream_wrappers in ./apdqc.module
Implements hook_stream_wrappers().

... See full list

File

./apdqc.module, line 1703
Asynchronous Prefetch Database Query Cache module.

Code

function apdqc_get_lang() {
  static $lang_shorthand;
  if (!isset($lang_shorthand)) {
    $language = language_default();
    if (isset($language->language)) {
      if (function_exists('apdqc_escape_string')) {
        $lang_shorthand = apdqc_escape_string($language->language);
      }
    }
  }
  if (isset($lang_shorthand)) {
    return $lang_shorthand;
  }
  return 'en';
}