secret
Last active

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
t("products.price");
*/
$(function() {
window.t = function(key) {
if(!key){
return "N/A";
}
var keys = key.split(".");
var comp = window.I18n;
$(keys).each(function(_, value) {
if(comp){
comp = comp[value];
}
});
 
if(!comp && console){
console.debug("No translation found for key: " + key);
return "N/A";
}
 
return comp;
};
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.