    /**
    @wal:Script permettant de gérer une internationalisation
    standardisé. 
    **/
    
    /** 
    * I18n est une classe permettant d'obtenir un libellé 
    * caractérisé par une clé dans une map contenant un 
    * ensemble de libellés traduits dans la langue choisie 
    * @constructor 
    */  
    var I18n = function(){}  
      
   /** 
   * Charge la map de clés/libellés 
   * @param {Object}  translations Les clés/libellés traduits 
   * @constructor 
   */  
   I18n.prototype.load = function(translations) {  
   this._translations = translations;  
   }  
     
   /** 
   * Remplace les nombres entre accolades ({0}) par les 
   * chaînes de caractères passées en paramètre 
   * exemple  : _format('Hello {0} ! ', 'wal') => Hello wal ! 
   * @param {String}  format La chaîne de caractère à formater 
   */  
   I18n.prototype._format = function(format) {  
   var args = Array.prototype.slice.call(arguments, 1);  
   return format.replace(/\{(\d+)\}/g, function(m, i){  
   return args[i];  
   });  
   }  
     
  /** 
   *  Retrouve le libellé correspondant à la clé passée en paramètre 
   * et le formate en fonction des paramètres supplémentaires 
   * exemple  : translate('hello', 'wal') => Hello wal ! 
   * @param {String}  key La clé à traduire 
  */  
  I18n.prototype.translate = function(key) {  
  if (typeof(this._translations)!='undefined' && this._translations[key]) {  
  return this._format(this._translations[key],Array.prototype.slice.call(arguments,1));  
  }  
  return key;  
  }  
