code: function substArguments(str, args, key) {
          var reArgs = /\{\{\s*(.+?)\s*\}\}/g;
          return str.replace(reArgs, function(matched_text, arg) {
              if (args && arg in args) {
                  return args[arg];
              }
              if (arg in gL10nData) {
                  return gL10nData[arg];
              }
              console.log("argument {{" + arg + "}} for #" + key + " is undefined.");
              return matched_text;
          });
      }
docs: replace {{arguments}} with their values