Add i18n content for moved core nodes

This commit is contained in:
Nick O'Leary
2015-06-16 10:36:19 +01:00
parent 36bc2e6b06
commit 7d011dac99
24 changed files with 689 additions and 418 deletions

View File

@@ -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">

View File

@@ -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() {

View File

@@ -0,0 +1,13 @@
{
"feedparse": {
"label": {
"feedurl": "Feed url",
"refresh": "Refresh",
"minutes": "minutes"
},
"errors": {
"badstatuscode": "error - Bad status code",
"invalidurl": "Invalid url"
}
}
}