You are here

public static function LingotekLocale::isSupportedLanguage in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  2. 8.2 src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  3. 4.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  4. 3.0.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  5. 3.1.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  6. 3.2.x src/LingotekLocale.php \Drupal\lingotek\LingotekLocale::isSupportedLanguage()
  7. 3.3.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 337

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]", [
      '@language' => $drupal_language_code,
    ]);
  }
  return $supported;
}