Add answer poll counts#6641
Conversation
There was a problem hiding this comment.
zero doesn't work. How to do that?
There was a problem hiding this comment.
The english pluralization rule doesn't make use of zero. And 0 votes is in fact the correct English.
There was a problem hiding this comment.
But it will still be presented to translators in webtranslateit automatically right?
Good then, I'll revert that.
|
Nice 👍 |
4a6b91c to
0e8a293
Compare
|
👍 |
|
I need a little help with the failing Jasmine test. The line |
0e8a293 to
7334686
Compare
|
Add the rendered element to the spec content and test the visibility there: diff --git a/spec/javascripts/app/views/poll_view_spec.js b/spec/javascripts/app/views/poll_view_spec.js
index 0b9b7d5..bbd4551 100644
--- a/spec/javascripts/app/views/poll_view_spec.js
+++ b/spec/javascripts/app/views/poll_view_spec.js
@@ -2,7 +2,7 @@ describe("app.views.Poll", function(){
beforeEach(function() {
loginAs({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
this.view = new app.views.Poll({ model: factory.postWithPoll()});
- this.view.render();
+ spec.content().html(this.view.render().el);
});
describe("setProgressBar", function(){
@@ -15,9 +15,9 @@ describe("app.views.Poll", function(){
describe("toggleResult", function(){
it("toggles the progress bar and result", function(){
- expect(this.view.$('.poll_progress_bar_wrapper:first').css('display')).toBe("none");
- this.view.toggleResult(null);
- expect(this.view.$('.poll_progress_bar_wrapper:first').css('display')).toBe("block");
+ expect($(".poll_progress_bar_wrapper:first")).toBeHidden();
+ this.view.toggleResult();
+ expect($(".poll_progress_bar_wrapper:first")).toBeVisible();
});
});You can run the jasmine tests locally with bin/rake jasmine:ciinstead of running them in the browser. Travis is doing the same thing. |
7334686 to
79f4594
Compare
There was a problem hiding this comment.
Strings must use doublequote.
79f4594 to
044d433
Compare
There was a problem hiding this comment.
Properties should be ordered font-weight, margin-bottom, vertical-align
044d433 to
16cee70
Compare
There was a problem hiding this comment.
I still have a bug here, looks like the "0" case is using the "one" translation. Any idea what's going on?
There was a problem hiding this comment.
Other translations in that file look like this:
reshares:
zero: "<%= count %> Reshares"
one: "<%= count %> Reshare"
other: "<%= count %> Reshares"
I'm not familiar with our translation code but I'd try to do the same here.
There was a problem hiding this comment.
@jhass told me a few days ago that zero was not needed for english and the "count" translation just above doesn't have it and works well, so really no idea where the problem is.
There was a problem hiding this comment.
My bad, the bug was there because the local was set to french, which needs a zero key. So, no bug.
There was a problem hiding this comment.
maybe you should add zero to the english translation, even if english doesn't need it, but other languages use this key as fallback.
There was a problem hiding this comment.
@SuperTux88 I did that first but then removed it following @jhass advice. Jonne what should we do here? (even if this doesn't block this PR so is maybe a out of topic discussion).
16cee70 to
1e27b50
Compare
|
Ok, should be ready to merge ;) |
|
Seems legit. Thank you! |
'cause my head doesn't want to calculate it anymore.