Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

translation of comments too

  • Loading branch information...
commit 040442fb0cf9f186ca12fb6692692485cb700fd0 1 parent 0c688e1
@lmatteis authored
Showing with 12 additions and 4 deletions.
  1. +8 −2 app.js
  2. +3 −1 config.js
  3. +1 −1  templates/partials/itemsubhead.html
View
10 app.js
@@ -252,6 +252,8 @@ ddoc.lists.all = function(head, req) {
var point = this.templates.partials.conf_point;
var points = this.templates.partials.conf_points;
+ var conf_comment = this.templates.partials.conf_comment;
+ var conf_comments = this.templates.partials.conf_comments;
var counter = 0;
while(row = getRow()) {
@@ -263,7 +265,8 @@ ddoc.lists.all = function(head, req) {
} else {
doc.points = row.value.points + ' ' + point;
}
- doc.numcomments = row.value.numcomments;
+
+ doc.numcomments = (row.value.numcomments > 1 ? row.value.numcomments + ' ' + conf_comments : row.value.numcomments + ' ' + conf_comment);
doc.counter = (++counter) + querySkip;
doc.pretty_date = util.timeDifference(new Date(), new Date(doc.created_at), this.templates.partials);
@@ -302,7 +305,10 @@ ddoc.lists.item = function(head, req) {
} else {
doc.points = value.points + ' ' + point;
}
- doc.numcomments = value.numcomments;
+ doc.numcomments = (value.numcomments > 1 ?
+ value.numcomments + ' ' + this.templates.partials.conf_comments :
+ value.numcomments + ' ' + this.templates.partials.conf_comment);
+
doc.pretty_date = util.timeDifference(currDate, new Date(doc.created_at), this.templates.partials);
// check if we upvoted already
View
4 config.js
@@ -28,8 +28,10 @@ module.exports = {
conf_yearago: 'anno fa',
conf_yearsago: 'anni fa',
- conf_discuss: 'discuti',
+ conf_comment: 'commento',
conf_comments: 'commenti',
+
+ conf_discuss: 'discuti',
conf_morelink : 'More',
conf_addcomment : 'aggiungi commento',
conf_commentreply : 'rispondi',
View
2  templates/partials/itemsubhead.html
@@ -1,4 +1,4 @@
<td class="subtext"><span>{{points}}
</span><a href=
"{{>conf_path}}user?id={{author}}">{{author}}</a> <span class="created_at">{{pretty_date}}</span> |
- <a href="{{>conf_path}}item?id={{_id}}">{{#numcomments}}{{numcomments}} {{>conf_comments}}{{/numcomments}}{{^numcomments}}{{>conf_discuss}}{{/numcomments}}</a></td>
+ <a href="{{>conf_path}}item?id={{_id}}">{{#numcomments}}{{numcomments}}{{/numcomments}}{{^numcomments}}{{>conf_discuss}}{{/numcomments}}</a></td>
Please sign in to comment.
Something went wrong with that request. Please try again.