You are here

function yashare_get_language in Yandex.Share 7

Same name and namespace in other branches
  1. 7.2 yashare.inc \yashare_get_language()

Returns selected language or protected language for API.

2 calls to yashare_get_language()
yashare_build in ./yashare.module
Generate renderable array.
yashare_settings in ./yashare.module
Returns settings form.

File

./yashare.inc, line 77
Yandex.Share helper functions.

Code

function yashare_get_language($protect = FALSE) {
  $lang = variable_get('yashare_l10n', 'auto');
  if (!$protect) {
    return $lang;
  }
  $langs = yashare_get_languages();
  if ($lang == 'auto') {
    global $language;
    $lang = $language->language;
    if (!array_key_exists($lang, $langs)) {
      $lang = 'ru';
    }
  }
  return $lang;
}