original_string: public function lang($name, $vars = [], $template = self::USE_NOT_TPL) {
          $request = Request::instance();
          $config = $this->resolve(RESOLVE_LANG, $name);
          $name = $config[1];
          $config = $config[0];
  
          if (isset($config[$request->lang][$name])) {
              if ($template == self::USE_NOT_TPL) {
                  if (count($vars) == 0) {
                      return $config[$request->lang][$name];
                  }
                  else {
                      $content = $config[$request->lang][$name];
  
                      foreach ($vars as $key => $value) {
                          $content = preg_replace('#\{' . $key . '\}#isU', $value, $content);
                      }
  
                      return $content;
                  }
              }
              else {
                  $tpl = new Template($config[$request->lang][$name], $name, 0, Template::TPL_STRING);
                  $tpl->assign($vars);
  
                  return $tpl->show(Template::TPL_COMPILE_TO_STRING, Template::TPL_COMPILE_LANG);
              }
          }
          else {
              $this->addError('sentence ' . $name . '/' . $request->lang . ' not found', __FILE__, __LINE__, ERROR_WARNING);
  
              return 'sentence not found (' . $name . ',' . $request->lang . ')';
          }
      }
code: public function lang($name, $vars = [], $template = self::USE_NOT_TPL) {
          $request = Request::instance();
          $config = $this->resolve(RESOLVE_LANG, $name);
          $name = $config[1];
          $config = $config[0];
  
          if (isset($config[$request->lang][$name])) {
              if ($template == self::USE_NOT_TPL) {
                  if (count($vars) == 0) {
                      return $config[$request->lang][$name];
                  }
                  else {
                      $content = $config[$request->lang][$name];
  
                      foreach ($vars as $key => $value) {
                          $content = preg_replace('#\{' . $key . '\}#isU', $value, $content);
                      }
  
                      return $content;
                  }
              }
              else {
                  $tpl = new Template($config[$request->lang][$name], $name, 0, Template::TPL_STRING);
                  $tpl->assign($vars);
  
                  return $tpl->show(Template::TPL_COMPILE_TO_STRING, Template::TPL_COMPILE_LANG);
              }
          }
          else {
              $this->addError('sentence ' . $name . '/' . $request->lang . ' not found', __FILE__, __LINE__, ERROR_WARNING);
  
              return 'sentence not found (' . $name . ',' . $request->lang . ')';
          }
      }
code_tokens: public function lang ( $ name , $ vars = [ ] , $ template = self :: USE_NOT_TPL ) { $ request = Request :: instance ( ) ; $ config = $ this -> resolve ( RESOLVE_LANG , $ name ) ; $ name = $ config [ 1 ] ; $ config = $ config [ 0 ] ; if ( isset ( $ config [ $ request -> lang ] [ $ name ] ) ) { if ( $ template == self :: USE_NOT_TPL ) { if ( count ( $ vars ) == 0 ) { return $ config [ $ request -> lang ] [ $ name ] ; } else { $ content = $ config [ $ request -> lang ] [ $ name ] ; foreach ( $ vars as $ key => $ value ) { $ content = preg_replace ( '#\{' . $ key . '\}#isU' , $ value , $ content ) ; } return $ content ; } } else { $ tpl = new Template ( $ config [ $ request -> lang ] [ $ name ] , $ name , 0 , Template :: TPL_STRING ) ; $ tpl -> assign ( $ vars ) ; return $ tpl -> show ( Template :: TPL_COMPILE_TO_STRING , Template :: TPL_COMPILE_LANG ) ; } } else { $ this -> addError ( 'sentence ' . $ name . '/' . $ request -> lang . ' not found' , __FILE__ , __LINE__ , ERROR_WARNING ) ; return 'sentence not found (' . $ name . ',' . $ request -> lang . ')' ; } }
docstring: load a sentence from config instance
  @access public
  @param $name     string : name of the sentence
  @param $vars     array : vars
  @param $template bool|int : use template syntax or not
  @return string
  @since 3.0
  @package Gcs\Framework\Core\Lang
docstring_tokens: load a sentence from config instance