You are here

public static function LingotekLocale::isSupportedLanguage in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  2. 4.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  3. 3.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  4. 3.1.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  5. 3.2.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  6. 3.3.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  7. 3.4.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  8. 3.5.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  9. 3.6.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  10. 3.7.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  11. 3.8.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()

Returns whether the given language is supported.

Return value

Boolean value.

File

src/LingotekLocale.php, line 335
Defines LingotekLocale class.

Class

LingotekLocale
A utility class for Lingotek translation.

Namespace

Drupal\lingotek

Code

public static function isSupportedLanguage($drupal_language_code, $enabled = TRUE) {

  //($drupal_language_code != LANGUAGE_NONE)
  $supported = self::convertDrupal2Lingotek($drupal_language_code, $enabled) !== FALSE;
  if (!$supported) {
    LingotekLog::warning("Unsupported language detected: [@language]", array(
      '@language' => $drupal_language_code,
    ));
  }
  return $supported;
}