original_string: protected function addTranslation($string, array $translations, $file)
      {
          if ($this->prepared && !isset($this->written[$file][$string]) && !empty($this->context)) {
  
              $data = array($string);
  
              if (isset($translations[$string][0]) && $translations[$string][0] !== '') {
                  $data = $translations[$string];
                  array_unshift($data, $string);
              }
  
              gplcart_file_csv($file, $data);
              $this->written[$file][$string] = true;
          }
      }
code: protected function addTranslation($string, array $translations, $file)
      {
          if ($this->prepared && !isset($this->written[$file][$string]) && !empty($this->context)) {
  
              $data = array($string);
  
              if (isset($translations[$string][0]) && $translations[$string][0] !== '') {
                  $data = $translations[$string];
                  array_unshift($data, $string);
              }
  
              gplcart_file_csv($file, $data);
              $this->written[$file][$string] = true;
          }
      }
code_tokens: protected function addTranslation ( $ string , array $ translations , $ file ) { if ( $ this -> prepared && ! isset ( $ this -> written [ $ file ] [ $ string ] ) && ! empty ( $ this -> context ) ) { $ data = array ( $ string ) ; if ( isset ( $ translations [ $ string ] [ 0 ] ) && $ translations [ $ string ] [ 0 ] !== '' ) { $ data = $ translations [ $ string ] ; array_unshift ( $ data , $ string ) ; } gplcart_file_csv ( $ file , $ data ) ; $ this -> written [ $ file ] [ $ string ] = true ; } }
docstring: Append the string to the translation file
  @param string $string
  @param array $translations
  @param string $file
docstring_tokens: Append the string to the translation file