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