public function getLocale(): string
    {
        foreach ($this->getAcceptedLocales() as $locale) {
            if (file_exists($this->translationsDir.'/messages.'.$locale.'.xlf')) {
                return $locale;
            }
        }

        return 'en';
    }
public function getLocale(): string
    {
        foreach ($this->getAcceptedLocales() as $locale) {
            if (file_exists($this->translationsDir.'/messages.'.$locale.'.xlf')) {
                return $locale;
            }
        }

        return 'en';
    }
Returns the first available locale.