original_string: public function setLocale()
      {
          // Initialize Locale if set and configured.
          if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
              $language = $this['language']->getLanguage();
              setlocale(LC_ALL, \strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);
          } elseif ($this['config']->get('system.default_locale')) {
              setlocale(LC_ALL, $this['config']->get('system.default_locale'));
          }
      }
code: public function setLocale()
      {
          // Initialize Locale if set and configured.
          if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
              $language = $this['language']->getLanguage();
              setlocale(LC_ALL, \strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);
          } elseif ($this['config']->get('system.default_locale')) {
              setlocale(LC_ALL, $this['config']->get('system.default_locale'));
          }
      }
code_tokens: public function setLocale ( ) { // Initialize Locale if set and configured. if ( $ this [ 'language' ] -> enabled ( ) && $ this [ 'config' ] -> get ( 'system.languages.override_locale' ) ) { $ language = $ this [ 'language' ] -> getLanguage ( ) ; setlocale ( LC_ALL , \ strlen ( $ language ) < 3 ? ( $ language . '_' . strtoupper ( $ language ) ) : $ language ) ; } elseif ( $ this [ 'config' ] -> get ( 'system.default_locale' ) ) { setlocale ( LC_ALL , $ this [ 'config' ] -> get ( 'system.default_locale' ) ) ; } }
docstring: Set the system locale based on the language and configuration
docstring_tokens: Set the system locale based on the language and configuration