src/anekdotes/I18n.php
public function t()
  {
      $args = func_get_args();
      $locales = count($this->supportedLocales);

      if (empty($args)) {
          return '';
      }

      if ($locales == 0) {
          return '';
      }

      if ($locales != count($args)) {
          $args = array_slice($args, 0, $locales);
      }

      if ($locales - count($args) > 0) {
          $args = array_merge($args, array_fill(0, $locales - count($args), ''));
      }

      $translations = array_combine($this->supportedLocales, $args);

      return $translations[$this->currentLocale];
  }
public function t()
  {
      $args = func_get_args();
      $locales = count($this->supportedLocales);

      if (empty($args)) {
          return '';
      }

      if ($locales == 0) {
          return '';
      }

      if ($locales != count($args)) {
          $args = array_slice($args, 0, $locales);
      }

      if ($locales - count($args) > 0) {
          $args = array_merge($args, array_fill(0, $locales - count($args), ''));
      }

      $translations = array_combine($this->supportedLocales, $args);

      return $translations[$this->currentLocale];
  }
public function t ( ) { $ args = func_get_args ( ) ; $ locales = count ( $ this -> supportedLocales ) ; if ( empty ( $ args ) ) { return '' ; } if ( $ locales == 0 ) { return '' ; } if ( $ locales != count ( $ args ) ) { $ args = array_slice ( $ args , 0 , $ locales ) ; } if ( $ locales - count ( $ args ) > 0 ) { $ args = array_merge ( $ args , array_fill ( 0 , $ locales - count ( $ args ) , '' ) ) ; } $ translations = array_combine ( $ this -> supportedLocales , $ args ) ; return $ translations [ $ this -> currentLocale ] ; }
Give the proper translation based on the locale.

@param  string  Here are a lot of parameters. Each parameter corresponds to a translation, in order in which they are in supported locales

@return string  The string corresponding to the current locale
Give the proper translation based on the locale .