public function __construct($publicKey, $locale = null) { if (null === $publicKey) { throw new InvalidConfigurationException('The parameters "public_key" must be configured.'); } $this->publicKey = $publicKey; if (null !== $locale) { $this->locale = $locale; } else { $this->locale = Locale::getDefault(); } }
private function retrieveInterfaceLanguages() { //Setting the default locale to english Locale::setDefault('en'); $languages = []; //We want all the names of languages translated in all supported languages $source_languages = app('config')->get('app.supported_locales'); if (!empty($source_languages)) { $target_languages = $source_languages; foreach ($source_languages as $language) { foreach ($target_languages as $targetLanguage) { $languages[$language][$targetLanguage] = ucfirst(Intl::getLanguageBundle()->getLanguageName($targetLanguage, null, $language)); } } } return $languages; }