Yasumi\Translations::isValidLocale PHP Method

isValidLocale() protected method

Checks whether the given locale is a valid/available locale.
protected isValidLocale ( string $locale ) : true
$locale string locale the locale to be validated
return true upon success, otherwise an UnknownLocaleException is thrown
    protected function isValidLocale($locale)
    {
        if (!in_array($locale, $this->availableLocales)) {
            throw new UnknownLocaleException(sprintf('Locale "%s" is not a valid locale.', $locale));
        }
        return true;
    }