Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

19 wiersze
553 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. }