mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Fix merge conflicts on i18n
This commit is contained in:
@@ -16,19 +16,18 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="irc in">
|
||||
<div class="form-row">
|
||||
<label for="node-input-ircserver"><i class="fa fa-globe"></i> IRC Server</label>
|
||||
<label for="node-input-ircserver"><i class="fa fa-globe"></i> <span data-i18n="irc.label.ircserver"></span></label>
|
||||
<input type="text" id="node-input-ircserver">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
|
||||
<label for="node-input-channel"><i class="fa fa-random"></i> <span data-i18n="irc.label.channel"></span></label>
|
||||
<input type="text" id="node-input-channel" placeholder="#nodered">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips">The channel to join must start with a # (as per normal irc rules...)<br/>
|
||||
You may join multiple channels by comma separating a list - #chan1,#chan2,etc.</div>
|
||||
<div class="form-tips"><span data-i18n="[html]irc.tip.in"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="irc in">
|
||||
@@ -118,27 +117,26 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="irc out">
|
||||
<div class="form-row">
|
||||
<label for="node-input-ircserver"><i class="fa fa-globe"></i> IRC Server</label>
|
||||
<label for="node-input-ircserver"><i class="fa fa-globe"></i> <span data-i18n="irc.label.ircserver"></span></label>
|
||||
<input type="text" id="node-input-ircserver">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
|
||||
<label for="node-input-channel"><i class="fa fa-random"></i> <span data-i18n="irc.label.channel"></span></label>
|
||||
<input type="text" id="node-input-channel" placeholder="#nodered">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-sendObject"><i class="fa fa-arrows"></i> Action</label>
|
||||
<label for="node-input-sendObject"><i class="fa fa-arrows"></i> <span data-i18n="irc.label.action"></span></label>
|
||||
<select type="text" id="node-input-sendObject" style="display: inline-block; vertical-align: middle; width:70%;">
|
||||
<option value="pay">Send payload to channel(s)</option>
|
||||
<option value="true">Use msg.topic to set nickname or channel(s)</option>
|
||||
<option value="false">Send complete msg object to channel(s)</option>
|
||||
<option value="pay" data-i18n="irc.payload"></option>
|
||||
<option value="true" data-i18n="irc.topic"></option>
|
||||
<option value="false" data-i18n="irc.msg"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||
</div>
|
||||
<div class="form-tips">The channel to join must start with a # (as per normal irc rules...)<br/>
|
||||
Sending the complete object will stringify the whole msg object before sending.</div>
|
||||
<div class="form-tips"><span data-i18n="[html]irc.tip.out"></span></div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="irc out">
|
||||
@@ -183,24 +181,24 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="irc-server">
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-server"><i class="fa fa-globe"></i> IRC Server</label>
|
||||
<label for="node-config-input-server"><i class="fa fa-globe"></i> <span data-i18n="irc.label.ircserver"></span></label>
|
||||
<input type="text" id="node-config-input-server" placeholder="irc.freenode.net" style="width: 45%;" >
|
||||
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> Port</label>
|
||||
<input type="text" id="node-config-input-port" placeholder="Port" style="width:45px">
|
||||
<label for="node-config-input-port" style="margin-left: 10px; width: 35px; "> <span data-i18n="irc.label.port"></span></label>
|
||||
<input type="text" id="node-config-input-port" style="width:45px">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label> </label>
|
||||
<input type="checkbox" id="node-config-input-ssl" style="display: inline-block; width: auto; vertical-align: top;">
|
||||
<label for="node-config-input-ssl" style="width: 70%;">Use Secure SSL connection ?</label>
|
||||
<label for="node-config-input-ssl" style="width: 70%;"><span data-i18n="irc.label.ssl"></span></label>
|
||||
</div>
|
||||
<div class="form-row" id="certrow">
|
||||
<label> </label>
|
||||
<input type="checkbox" id="node-config-input-cert" style="display: inline-block; width: auto; vertical-align: top;">
|
||||
<label for="node-config-input-cert" style="width: 70%;">Allow self-signed certificates ?</label>
|
||||
<label for="node-config-input-cert" style="width: 70%;"><span data-i18n="irc.label.self"></span></label>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-config-input-nickname"><i class="fa fa-user"></i> Nickname</label>
|
||||
<input type="text" id="node-config-input-nickname" placeholder="joe123">
|
||||
<label for="node-config-input-nickname"><i class="fa fa-user"></i> <span data-i18n="irc.label.nickname"></span></label>
|
||||
<input type="text" id="node-config-input-nickname">
|
||||
</div>
|
||||
</script>
|
||||
|
||||
|
@@ -47,45 +47,45 @@ module.exports = function(RED) {
|
||||
this.channel = n.channel || this.serverConfig.channel;
|
||||
var node = this;
|
||||
if (node.serverConfig.ircclient === null) {
|
||||
node.log("CONNECT: "+node.serverConfig.server);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"});
|
||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
||||
node.status({fill:"grey",shape:"dot",text:"node-red:common.status.connecting"});
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||
node.serverConfig.ircclient.setMaxListeners(0);
|
||||
node.serverConfig.ircclient.addListener('error', function(message) {
|
||||
if (RED.settings.verbose) { node.log("ERR: "+JSON.stringify(message)); }
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.err")+": "+JSON.stringify(message)); }
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('netError', function(message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("NET: "+JSON.stringify(message)); }
|
||||
node.status({fill:"red",shape:"ring",text:"net error"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
||||
node.status({fill:"red",shape:"ring",text:"node-red:common.status.neterror"});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('connect', function() {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("CONNECTED "); }
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connected")); }
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('registered', function(message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
node.log(node.serverConfig.ircclient.nick+" ONLINE: "+message.server);
|
||||
node.status({fill:"yellow",shape:"dot",text:"connected"});
|
||||
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
||||
node.status({fill:"yellow",shape:"dot",text:"node-red:common.status.connected"});
|
||||
node.serverConfig.ircclient.join( node.channel, function(data) {
|
||||
node.log(data+" JOINED: "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"joined"});
|
||||
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.joined"});
|
||||
});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('ping', function(server) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("PING from "+JSON.stringify(server)); }
|
||||
node.status({fill:"green",shape:"dot",text:"ok"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.ok"});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("QUIT: "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||
node.status({fill:"grey",shape:"ring",text:"quit"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.quit"});
|
||||
//node.serverConfig.ircclient.disconnect( function() {
|
||||
// node.serverConfig.ircclient.connect();
|
||||
//});
|
||||
//if (RED.settings.verbose) { node.log("restart"); } // then retry
|
||||
//if (RED.settings.verbose) { node.log(RED._("irc.errors.restart")); } // then retry
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('raw', function (message) { // any message received means we are alive
|
||||
//console.log("RAW:"+JSON.stringify(message));
|
||||
@@ -102,8 +102,8 @@ module.exports = function(RED) {
|
||||
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
||||
//node.serverConfig.ircclient.disconnect();
|
||||
//node.serverConfig.ircclient.connect();
|
||||
node.status({fill:"grey",shape:"ring",text:"no connection"});
|
||||
if (RED.settings.verbose) { node.log("CONNECTION LOST ?"); }
|
||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.noconnection"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
||||
}
|
||||
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
||||
}, 60000); // check every 1 min
|
||||
@@ -113,11 +113,11 @@ module.exports = function(RED) {
|
||||
node.ircclient = node.serverConfig.ircclient;
|
||||
|
||||
node.ircclient.addListener('registered', function(message) {
|
||||
//node.log(node.ircclient.nick+" ONLINE");
|
||||
node.status({fill:"yellow",shape:"dot",text:"connected"});
|
||||
//node.log(node.ircclient.nick+" "+RED._("irc.errors.online"));
|
||||
node.status({fill:"yellow",shape:"dot",text:"node-red:common.status.connected"});
|
||||
node.ircclient.join( node.channel, function(data) {
|
||||
// node.log(data+" JOINED "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"joined"});
|
||||
// node.log(data+" "+RED._("irc.errors.joined")+" "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.joined"});
|
||||
});
|
||||
});
|
||||
node.ircclient.addListener('message', function (from, to, message) {
|
||||
@@ -136,27 +136,27 @@ module.exports = function(RED) {
|
||||
node.ircclient.addListener('join', function(channel, who) {
|
||||
var msg = { "payload": { "type":"join", "who":who, "channel":channel } };
|
||||
node.send([null,msg]);
|
||||
//node.log(who+' has joined '+channel);
|
||||
//node.log(who+' '+RED._("irc.errors.hasjoined")+' '+channel);
|
||||
});
|
||||
node.ircclient.addListener('invite', function(channel, from, message) {
|
||||
var msg = { "payload": { "type":"invite", "who":from, "channel":channel, "message":message } };
|
||||
node.send([null,msg]);
|
||||
//node.log(from+' sent invite to '+channel+': '+message);
|
||||
//node.log(from+' '+RED._("irc.errors.sentinvite")+' '+channel+': '+message);
|
||||
});
|
||||
node.ircclient.addListener('part', function(channel, who, reason) {
|
||||
var msg = { "payload": { "type":"part", "who":who, "channel":channel, "reason":reason } };
|
||||
node.send([null,msg]);
|
||||
//node.log(who+' has left '+channel+': '+reason);
|
||||
//node.log(who+' '+RED._("irc.errors.hasleft")+' '+channel+': '+reason);
|
||||
});
|
||||
node.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
||||
var msg = { "payload": { "type":"quit", "who":nick, "channel":channels, "reason":reason } };
|
||||
node.send([null,msg]);
|
||||
//node.log(nick+' has quit '+channels+': '+reason);
|
||||
//node.log(nick+' '+RED._("irc.errors.hasquit")+' '+channels+': '+reason);
|
||||
});
|
||||
node.ircclient.addListener('kick', function(channel, who, by, reason) {
|
||||
var msg = { "payload": { "type":"kick", "who":who, "channel":channel, "by":by, "reason":reason } };
|
||||
node.send([null,msg]);
|
||||
//node.log(who+' was kicked from '+channel+' by '+by+': '+reason);
|
||||
//node.log(who+' '+RED._("irc.errors.kickedfrom")+' '+channel+' by '+by+': '+reason);
|
||||
});
|
||||
node.ircclient.addListener('names', function (channel, nicks) {
|
||||
var msg = { "payload": { "type": "names", "channel": channel, "names": nicks} };
|
||||
@@ -182,45 +182,45 @@ module.exports = function(RED) {
|
||||
this.channel = n.channel || this.serverConfig.channel;
|
||||
var node = this;
|
||||
if (node.serverConfig.ircclient === null) {
|
||||
node.log("CONNECT: "+node.serverConfig.server);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"});
|
||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
||||
node.status({fill:"grey",shape:"dot",text:"node-red:common.status.connecting"});
|
||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||
node.serverConfig.ircclient.setMaxListeners(0);
|
||||
node.serverConfig.ircclient.addListener('error', function(message) {
|
||||
if (RED.settings.verbose) { node.log("ERR: "+JSON.stringify(message)); }
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.err")+": "+JSON.stringify(message)); }
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('netError', function(message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("NET: "+JSON.stringify(message)); }
|
||||
node.status({fill:"red",shape:"ring",text:"net error"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
||||
node.status({fill:"red",shape:"ring",text:"node-red:common.status.neterror"});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('connect', function() {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("CONNECTED "); }
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connected")); }
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('registered', function(message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
node.log(node.serverConfig.ircclient.nick+" ONLINE: "+message.server);
|
||||
node.status({fill:"yellow",shape:"dot",text:"connected"});
|
||||
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
||||
node.status({fill:"yellow",shape:"dot",text:"node-red:common.status.connected"});
|
||||
node.serverConfig.ircclient.join( node.channel, function(data) {
|
||||
node.log(data+" JOINED: "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"joined"});
|
||||
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.joined"});
|
||||
});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('ping', function(server) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("PING from "+JSON.stringify(server)); }
|
||||
node.status({fill:"green",shape:"dot",text:"ok"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
||||
node.status({fill:"green",shape:"dot",text:"node-red:common.status.ok"});
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
||||
node.serverConfig.lastseen = Date.now();
|
||||
if (RED.settings.verbose) { node.log("QUIT: "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||
node.status({fill:"grey",shape:"ring",text:"quit"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.quit"});
|
||||
//node.serverConfig.ircclient.disconnect( function() {
|
||||
// node.serverConfig.ircclient.connect();
|
||||
//});
|
||||
//if (RED.settings.verbose) { node.log("restart"); } // then retry
|
||||
//if (RED.settings.verbose) { node.log(RED._("irc.errors.restart")); } // then retry
|
||||
});
|
||||
node.serverConfig.ircclient.addListener('raw', function (message) { // any message received means we are alive
|
||||
//console.log("RAW:"+JSON.stringify(message));
|
||||
@@ -237,8 +237,8 @@ module.exports = function(RED) {
|
||||
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
||||
//node.serverConfig.ircclient.disconnect();
|
||||
//node.serverConfig.ircclient.connect();
|
||||
node.status({fill:"grey",shape:"ring",text:"no connection"});
|
||||
if (RED.settings.verbose) { node.log("CONNECTION LOST ?"); }
|
||||
node.status({fill:"grey",shape:"ring",text:"node-red:common.status.noconnection"});
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
||||
}
|
||||
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
||||
}, 60000); // check every 1 min
|
||||
@@ -249,7 +249,7 @@ module.exports = function(RED) {
|
||||
|
||||
node.on("input", function(msg) {
|
||||
if (Object.prototype.toString.call( msg.raw ) === '[object Array]') {
|
||||
if (RED.settings.verbose) { node.log("RAW command:"+msg.raw); }
|
||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.rawcommand")+":"+msg.raw); }
|
||||
node.ircclient.send.apply(node.ircclient,msg.raw);
|
||||
}
|
||||
else {
|
||||
@@ -259,7 +259,7 @@ module.exports = function(RED) {
|
||||
if ((msg.hasOwnProperty('topic'))&&(typeof msg.topic === "string")) {
|
||||
ch = msg.topic.split(","); // split on , so we can send to multiple
|
||||
}
|
||||
else { node.warn("msg.topic not set"); }
|
||||
else { node.warn(RED._("irc.errors.topicnotset")); }
|
||||
}
|
||||
for (var c = 0; c < ch.length; c++) {
|
||||
if (node.sendFlag == "false") { // send whole message object to each channel
|
||||
|
39
social/irc/locales/en-US/91-irc.json
Normal file
39
social/irc/locales/en-US/91-irc.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"irc": {
|
||||
"label": {
|
||||
"ircserver": "IRC Server",
|
||||
"channel": "Channel",
|
||||
"action": "Action",
|
||||
"port": "Port",
|
||||
"ssl": "Use Secure SSL connection?",
|
||||
"self": "Allow self-signed certificates?",
|
||||
"nickname": "Nickname"
|
||||
},
|
||||
"payload": "Send payload to channel(s)",
|
||||
"topic": "Use msg.topic to set nickname or channel(s)",
|
||||
"msg": "Send complete msg object to channel(s)",
|
||||
"tip": {
|
||||
"in": "The channel to join must start with a #<br/>You may join multiple channels by comma separating a list - #chan1,#chan2,etc.",
|
||||
"out": "The channel to join must start with a #<br/>Sending the complete object will stringify the whole msg object before sending."
|
||||
},
|
||||
"errors": {
|
||||
"connect": "CONNECT",
|
||||
"err": "ERR",
|
||||
"net": "NET",
|
||||
"connected": "CONNECTED",
|
||||
"online": "ONLINE",
|
||||
"joined": "JOINED",
|
||||
"ping": "PING from",
|
||||
"quit": "QUIT",
|
||||
"restart": "restart",
|
||||
"connectionlost": "CONNECTION LOST?",
|
||||
"hasjoined": "has joined",
|
||||
"sentinvite": "sent invite to",
|
||||
"hasleft": "has left",
|
||||
"hasquit": "has quit",
|
||||
"kickedfrom": "was kicked from",
|
||||
"rawcommand": "RAW command",
|
||||
"topicnotset": "msg.topic not set"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user