Changeset 2198

Show
Ignore:
Timestamp:
04/24/08 20:07:11 (3 weeks ago)
Author:
anarcat
Message:

use strtr instead of printf to expand variables in translated strings

this means that the error arguments are now passed as an associative
array.

exemple:

$err->raise("foo", "error message: %error", array('%error' => "blah"));

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/class/m_err.php

    r2196 r2198  
    9191  function errstr() { 
    9292    if (is_string($this->error)) { 
    93       $msg = sprintf(_("err_".$this->clsid."_generic: ")._($this->error)."\n",$this->param); 
     93      $msg = strtr(_("err_".$this->clsid."_generic: ")._($this->error)."\n",$this->param); 
    9494    } else { 
    95       $msg = sprintf(_("err_".$this->clsid."_".$this->error)."\n",$this->param); 
     95      $msg = strtr(_("err_".$this->clsid."_".$this->error)."\n",$this->param); 
    9696    } 
    9797    return $msg;