Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

18 lignes
552 B

  1. // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. // MIT License. See license.txt
  3. // for translation
  4. wn._messages = {};
  5. wn._ = function(txt, replace) {
  6. if(!txt) return txt;
  7. if(typeof(txt) != "string") return txt;
  8. preformat = wn._messages[txt.replace(/\n/g, "")] || txt;
  9. if(!replace) return preformat;
  10. if(replace instanceof Array) return vsprintf(preformat, replace);
  11. return repl(preformat, replace);
  12. };
  13. wn.translate = function(obj, keys) {
  14. $.each(keys, function(i, key) {
  15. obj["_" + key] = wn._(obj[key]);
  16. })
  17. }