You are here

public static function ShareaholicUtilities::site_language in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3

Same name and namespace in other branches
  1. 8 utilities.php \ShareaholicUtilities::site_language()

Returns the site's primary locale / language

Return value

string

1 call to ShareaholicUtilities::site_language()
ShareaholicUtilities::get_or_create_api_key in ./utilities.php
Returns the api key or creates a new one.

File

./utilities.php, line 125

Class

ShareaholicUtilities

Code

public static function site_language() {
  $language_id_map = array(
    "ar" => 1,
    // Arabic
    "bg" => 2,
    // Bulgarian
    "zh-hans" => 3,
    // Chinese (Simplified)
    "zh-hant" => 4,
    // Chinese (Traditional)
    "hr" => 5,
    // Croatian
    "cs" => 6,
    // Czech
    "da" => 7,
    // Danish
    "nl" => 8,
    // Netherlands
    "en" => 9,
    // English
    "et" => 10,
    // Estonian
    "fi" => 11,
    // Finnish
    "fr" => 12,
    // French
    "de" => 13,
    // German
    "el" => 14,
    // Greek
    "he" => 15,
    // Hebrew
    "hu" => 16,
    // Hungarian
    "id" => 17,
    // Indonesian
    "it" => 18,
    // Italian
    "ja" => 19,
    // Japanese
    "ko" => 20,
    // Korean
    "lv" => 21,
    // Lativan
    "lt" => 22,
    // Lithuanian
    "nn" => 23,
    // Norwegian
    "pl" => 24,
    // Poland
    "pt-pt" => 25,
    // Portuguese
    "ro" => 26,
    // Romanian
    "ru" => 27,
    // Russian
    "sr" => 28,
    // Serbian
    "sk" => 29,
    // Slovak
    "sl" => 30,
    // Slovenian
    "es" => 31,
    // Spanish
    "sv" => 32,
    // Swedish
    "th" => 33,
    // Thai
    "tr" => 34,
    // Turkish
    "uk" => 35,
    // Ukrainian
    "vi" => 36,
  );
  $language = $GLOBALS['language']->language;
  return isset($language_id_map[$language]) ? $language_id_map[$language] : NULL;
}