original_string: public function loadFromFile($pattern)
      {
          if (isset($this->files[$pattern])) {
              return $this;
          }
  
          $file = sprintf($pattern, $this->locale);
          if (!is_file($file)) {
              $defaultFile = sprintf($pattern, $this->defaultLocale);
              if (!is_file($defaultFile)) {
                  throw new \InvalidArgumentException(sprintf('File "%s" and "%s" not found or not readable', $file, $defaultFile));
              } else {
                  $file = $defaultFile;
              }
          }
  
          $this->files[$pattern] = true;
  
          return $this->loadFromArray(require $file);
      }
code: public function loadFromFile($pattern)
      {
          if (isset($this->files[$pattern])) {
              return $this;
          }
  
          $file = sprintf($pattern, $this->locale);
          if (!is_file($file)) {
              $defaultFile = sprintf($pattern, $this->defaultLocale);
              if (!is_file($defaultFile)) {
                  throw new \InvalidArgumentException(sprintf('File "%s" and "%s" not found or not readable', $file, $defaultFile));
              } else {
                  $file = $defaultFile;
              }
          }
  
          $this->files[$pattern] = true;
  
          return $this->loadFromArray(require $file);
      }
code_tokens: public function loadFromFile ( $ pattern ) { if ( isset ( $ this -> files [ $ pattern ] ) ) { return $ this ; } $ file = sprintf ( $ pattern , $ this -> locale ) ; if ( ! is_file ( $ file ) ) { $ defaultFile = sprintf ( $ pattern , $ this -> defaultLocale ) ; if ( ! is_file ( $ defaultFile ) ) { throw new \ InvalidArgumentException ( sprintf ( 'File "%s" and "%s" not found or not readable' , $ file , $ defaultFile ) ) ; } else { $ file = $ defaultFile ; } } $ this -> files [ $ pattern ] = true ; return $ this -> loadFromArray ( require $ file ) ; }
docstring: Loads translator messages from file
  
  @param string $pattern The file path, which can contains %s that would be convert the current locale or fallback locale
  @return $this
  @throws \InvalidArgumentException When file not found or not readable
docstring_tokens: Loads translator messages from file