/** * {@inheritdoc} */ public function getLocale() { if ($this->session) { return $this->session->getLocale(); } return $this->defaultLocale; }
/** * Get the language name in the used locale * * @param string $language the iso code of the language * @return string */ public function getLanguageName($language) { return \Locale::getDisplayLanguage($language, $this->session->getLocale()); }
/** * Set the translation listener locale from the session. * * @param Session $session * @return void */ public function setTranslatableLocaleFromSession(Session $session = null) { if ($session !== null) { $this->setTranslatableLocale($session->getLocale()); } }