original_string: protected function _initLocale()
      {
          $this->bootstrap(array('project', 'session'));
  
          // Get the choosen language
          if (isset($this->session->user_locale)) {
              $localeId = $this->session->user_locale;
              // \MUtil_Echo::r('sess: ' . $localeId);
  
          } else {
              if (isset($this->project->locale, $this->project->locale['default'])) {
                  // As set in project
                  $localeId = $this->project->locale['default'];
                  // \MUtil_Echo::r('def: ' . $localeId);
  
              } elseif (isset($this->project->locales)) {
                  // First of the locales array.
                  $localeId = reset($this->project->locales);
                  // \MUtil_Echo::r('locales: ' . $localeId);
  
  
              } else {
                  // Default.
                  $localeId = 'en';
              }
  
              $this->session->user_locale = $localeId;
          }
  
          $locale = new \Zend_Locale($localeId);
  
          \Zend_Registry::set('Zend_Locale', $locale);
  
          return $locale;
      }
code: protected function _initLocale()
      {
          $this->bootstrap(array('project', 'session'));
  
          // Get the choosen language
          if (isset($this->session->user_locale)) {
              $localeId = $this->session->user_locale;
              // \MUtil_Echo::r('sess: ' . $localeId);
  
          } else {
              if (isset($this->project->locale, $this->project->locale['default'])) {
                  // As set in project
                  $localeId = $this->project->locale['default'];
                  // \MUtil_Echo::r('def: ' . $localeId);
  
              } elseif (isset($this->project->locales)) {
                  // First of the locales array.
                  $localeId = reset($this->project->locales);
                  // \MUtil_Echo::r('locales: ' . $localeId);
  
  
              } else {
                  // Default.
                  $localeId = 'en';
              }
  
              $this->session->user_locale = $localeId;
          }
  
          $locale = new \Zend_Locale($localeId);
  
          \Zend_Registry::set('Zend_Locale', $locale);
  
          return $locale;
      }
code_tokens: protected function _initLocale ( ) { $ this -> bootstrap ( array ( 'project' , 'session' ) ) ; // Get the choosen language if ( isset ( $ this -> session -> user_locale ) ) { $ localeId = $ this -> session -> user_locale ; // \MUtil_Echo::r('sess: ' . $localeId); } else { if ( isset ( $ this -> project -> locale , $ this -> project -> locale [ 'default' ] ) ) { // As set in project $ localeId = $ this -> project -> locale [ 'default' ] ; // \MUtil_Echo::r('def: ' . $localeId); } elseif ( isset ( $ this -> project -> locales ) ) { // First of the locales array. $ localeId = reset ( $ this -> project -> locales ) ; // \MUtil_Echo::r('locales: ' . $localeId); } else { // Default. $ localeId = 'en' ; } $ this -> session -> user_locale = $ localeId ; } $ locale = new \ Zend_Locale ( $ localeId ) ; \ Zend_Registry :: set ( 'Zend_Locale' , $ locale ) ; return $ locale ; }
docstring: Initialize the locale.
  
  We use this function instead of the standard application.ini setting to
  simplify overruling the settings.
  
  Also Firefox tends to overrule the locale settings.
  
  You can overrule this function to specify your own project translation method / file.
  
  Use $this->locale to access afterwards
  
  @return \Zend_Locale
docstring_tokens: Initialize the locale .