<?

/**
 * Translation object
 *
 * This is a class that should handle any message in the application.
 * When setting the translate boolean to true it is possible to see which
 * messages use the translation mechanism, because the messsages (that were
 * not translated) are suffixed with a *-sign.
 * @package   Include
 * @author    Herman Suijs
 */
class Translator {
  var 
$translate;

  
/**
   * Constructor of the Translator
   */
  
function Translator($translate=TRANS_BY_DEFAULT) {
    
$this->translate $translate;
  } 
/* function Translator($translate... */

  /**
   * Translation function
   */
  
function translate($message,$var1="",$var2="",$var3="",$var4="",$var5="",$var6="",$var7="",$var8="",$var9="",$var10="",$var11="",$var12="") {
    if (
$this->translate) {
      
// Do whatever is needed to translate
      // e.g. return sprintf(_($message),...)
      
return sprintf($message."*",$var1,$var2,$var3,$var4,$var5,$var6,$var7,$var8,$var9,$var10,$var11,$var12);
    } else { 
/* if ($this->translate) */
      
return sprintf($message,$var1,$var2,$var3,$var4,$var5,$var6,$var7,$var8,$var9,$var10,$var11,$var12);
   
/* if ($this->translate) { ... } ... */  }
  } 
/* function translate($message,$v... */

// end class Translator /* class Translator */