mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add i18n content for moved core nodes
This commit is contained in:
@@ -16,18 +16,17 @@
|
||||
|
||||
<script type="text/x-red" data-template-name="feedparse">
|
||||
<div class="form-row">
|
||||
<label for="node-input-url"><i class="fa fa-globe"></i> Feed url</label>
|
||||
<label for="node-input-url"><i class="fa fa-globe"></i> <span data-i18n="feedparse.label.feedurl"></span></label>
|
||||
<input type="text" id="node-input-url">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-interval"><i class="fa fa-repeat"></i> Repeat <span style="font-size: 0.9em;">(M)</span></label>
|
||||
<input type="text" id="node-input-interval" placeholder="minutes">
|
||||
<label for="node-input-interval"><i class="fa fa-repeat"></i> <span data-i18n="feedparse.label.refresh"></span></label>
|
||||
<input type="text" id="node-input-interval" style="width: 50px"> <span data-i18n="feedparse.label.minutes"></span>
|
||||
</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="common.label.name"></span></label>
|
||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
||||
</div>
|
||||
<!-- <div class="form-tips"></div> -->
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="feedparse">
|
||||
|
@@ -38,7 +38,7 @@ module.exports = function(RED) {
|
||||
req.on('error', function(err) { node.error(err); });
|
||||
|
||||
req.on('response', function(res) {
|
||||
if (res.statusCode != 200) { node.warn('error - Bad status code'); }
|
||||
if (res.statusCode != 200) { node.warn(RED._("feedparse.errors.badstatuscode")); }
|
||||
else { res.pipe(feedparser); }
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ module.exports = function(RED) {
|
||||
|
||||
feedparser.on('readable', function () {
|
||||
var stream = this, article;
|
||||
while (article = stream.read()) { // jshint ignore:line
|
||||
while (article = stream.read()) {
|
||||
if (!(article.guid in node.seen) || ( node.seen[article.guid] !== 0 && node.seen[article.guid] != article.date.getTime())) {
|
||||
node.seen[article.guid] = article.date?article.date.getTime():0;
|
||||
var msg = {
|
||||
@@ -65,7 +65,7 @@ module.exports = function(RED) {
|
||||
this.interval_id = setInterval(function() { getFeed(); }, node.interval);
|
||||
getFeed();
|
||||
} else {
|
||||
this.error("Invalid url");
|
||||
this.error(RED._("feedparse.errors.invalidurl"));
|
||||
}
|
||||
|
||||
this.on("close", function() {
|
||||
|
13
social/feedparser/locales/en-US/32-feedparse.json
Normal file
13
social/feedparser/locales/en-US/32-feedparse.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"feedparse": {
|
||||
"label": {
|
||||
"feedurl": "Feed url",
|
||||
"refresh": "Refresh",
|
||||
"minutes": "minutes"
|
||||
},
|
||||
"errors": {
|
||||
"badstatuscode": "error - Bad status code",
|
||||
"invalidurl": "Invalid url"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user