public static function LingotekLanguageForm::isValidLocale in Lingotek Translation 8
Same name and namespace in other branches
- 8.2 src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 4.0.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.0.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.1.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.2.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.3.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.4.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.5.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.6.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.7.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
- 3.8.x src/Form/LingotekLanguageForm.php \Drupal\lingotek\Form\LingotekLanguageForm::isValidLocale()
Checks if a locale is valid.
Parameters
string $locale: The locale to validate.
Return value
bool TRUE if it's a valid locale in Lingotek. FALSE if not.
1 call to LingotekLanguageForm::isValidLocale()
- LingotekLanguageForm::validateLocale in src/
Form/ LingotekLanguageForm.php - Validate the configurable language type form with lingotek options.
File
- src/
Form/ LingotekLanguageForm.php, line 131
Class
- LingotekLanguageForm
- Alters the Drupal language module language forms.
Namespace
Drupal\lingotek\FormCode
public static function isValidLocale($locale) {
$locales = \Drupal::service('lingotek')
->getLocales();
return in_array($locale, $locales);
}