Example #1
0
 function _getLocaleForRequest(&$Request)
 {
     $lang = $this->getNavigationLanguage();
     if ($url_locale = $this->getLangFromUrl($Request)) {
         $lang = $this->getLocaleFromAlias($url_locale);
     }
     if (!$this->_canUseLocaleOnCurrentRequest($lang, $Request)) {
         $lang = array_shift($this->getPublicLocales());
     } elseif (empty($lang)) {
         $lang = array_shift($this->getPublicLocales());
     }
     // This way we store on get_url_locale and on lang the value of $lang on
     // a static variable for accessing it application wide
     empty($url_locale) ? null : Ak::get_url_locale($url_locale);
     Ak::lang($lang);
     return $lang;
 }
Example #2
0
 /**
  * Returns the locale identifier of current URL
  */
 function getLocaleFromUrl()
 {
     $locale = Ak::get_url_locale();
     if (strstr(AK_CURRENT_URL, AK_SITE_URL . '/' . $locale)) {
         return $locale;
     }
     return '';
 }
Example #3
0
 /**
  * Returns the locale identifier of current URL
  */
 public function getLocaleFromUrl()
 {
     $locale = Ak::get_url_locale();
     if (strstr($this->getUrl(), AK_SITE_URL . $locale)) {
         return $locale;
     }
     return '';
 }