diff --git a/app/views/templates/comment.jst b/app/views/templates/comment.jst
index 6d52a3c0d..519ba69ac 100644
--- a/app/views/templates/comment.jst
+++ b/app/views/templates/comment.jst
@@ -1,7 +1,7 @@
- Original post deleted by author.
+ <%= Diaspora.I18n.t('stream.original_post_deleted') %>
<% } %>
diff --git a/app/views/templates/stream_element.jst b/app/views/templates/stream_element.jst
index 544df17cd..c10c7b8a2 100644
--- a/app/views/templates/stream_element.jst
+++ b/app/views/templates/stream_element.jst
@@ -1,8 +1,8 @@
<% } %>
diff --git a/config/locales/javascript/javascript.en.yml b/config/locales/javascript/javascript.en.yml
index d0d086294..745cae215 100644
--- a/config/locales/javascript/javascript.en.yml
+++ b/config/locales/javascript/javascript.en.yml
@@ -6,6 +6,8 @@
en:
javascripts:
confirm_dialog: "Are you sure?"
+ delete: "Delete"
+ ignore: "Ignore"
timeago:
prefixAgo: ""
prefixFromNow: ""
@@ -32,8 +34,6 @@ en:
public: "Public - your post will be visible to everyone and found by search engines"
infinite_scroll:
no_more: "No more posts."
- web_sockets:
- disconnected: "The websocket is closed; posts will no longer be streamed live."
aspect_dropdown:
add_to_aspect: "Add contact"
select_aspects: "Select aspects"
@@ -44,7 +44,6 @@ en:
toggle:
zero: "Select aspects"
one: "In <%= count %> aspect"
- two: "In <%= count %> aspects"
few: "In <%= count %> aspects"
many: "In <%= count %> aspects"
other: "In <%= count %> aspects"
@@ -69,3 +68,52 @@ en:
looking_good: "OMG, you look awesome!"
tags:
wasnt_that_interesting: "OK, I suppose #<%= tagName %> wasn't all that interesting..."
+
+ stream:
+ public: "Public"
+ limited: "Limited"
+ like: "Like"
+ unlike: "Unlike"
+ reshare: "Reshare"
+ comment: "Comment"
+ original_post_deleted: "Original post deleted by author."
+ nsfw: "This post has been flagged NSFW by its author."
+ show: "Show"
+
+ likes:
+ zero: "<%= count %> Likes"
+ one: "<%= count %> Like"
+ few: "<%= count %> Likes"
+ many: "<%= count %> Likes"
+ other: "<%= count %> Likes"
+
+ reshares:
+ zero: "<%= count %> Reshares"
+ one: "<%= count %> Reshare"
+ few: "<%= count %> Reshares"
+ many: "<%= count %> Reshares"
+ other: "<%= count %> Reshares"
+
+ more_comments:
+ zero: "Show <%= count %> more comments"
+ one: "Show <%= count %> more comment"
+ few: "Show <%= count %> more comments"
+ many: "Show <%= count %> more comments"
+ other: "Show <%= count %> more comments"
+
+ header:
+ home: "Home"
+ profile: "Profile"
+ contacts: "Contacts"
+ settings: "Settings"
+ log_out: "Log out"
+
+ notifications: "Notifications"
+ messages: "Messages"
+
+ search: "Find people or #tags"
+
+ recent_notifications: "Recent Notifications"
+ mark_all_as_read: "Mark all as read"
+ view_all: "View all"
+
diff --git a/features/notifications.feature b/features/notifications.feature
index 8677685a2..850a42914 100644
--- a/features/notifications.feature
+++ b/features/notifications.feature
@@ -14,7 +14,7 @@ Feature: Notifications
And I add the person to my "Besties" aspect
And I go to the destroy user session page
When I sign in as "alice@alice.alice"
- And I follow "notification" in the header
+ And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible
Then I should see "started sharing with you"
@@ -32,10 +32,10 @@ Feature: Notifications
And I wait for the ajax to finish
And I go to the destroy user session page
When I sign in as "alice@alice.alice"
- And I follow "notification" in the header
- And I wait for the ajax to finish
+ And I follow "Notifications" in the header
+ #And I wait for the ajax to finish
Then the notification dropdown should be visible
- And I wait for the ajax to finish
+ #And I wait for the ajax to finish
Then I should see "reshared your post"
And I should have 1 email delivery
@@ -49,7 +49,7 @@ Feature: Notifications
And I wait for the ajax to finish
And I go to the destroy user session page
When I sign in as "alice@alice.alice"
- And I follow "notification" in the header
+ And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible
And I wait for the ajax to finish
@@ -67,7 +67,7 @@ Feature: Notifications
And I wait for the ajax to finish
And I go to the destroy user session page
When I sign in as "alice@alice.alice"
- And I follow "notification" in the header
+ And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible
And I wait for the ajax to finish
@@ -78,7 +78,7 @@ Feature: Notifications
Given a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And Alice has a post mentioning Bob
When I sign in as "bob@bob.bob"
- And I follow "notification" in the header
+ And I follow "Notifications" in the header
And I wait for the ajax to finish
Then the notification dropdown should be visible
And I wait for the ajax to finish
diff --git a/public/javascripts/app/views/header_view.js b/public/javascripts/app/views/header_view.js
index eeb6f03d1..287aea407 100644
--- a/public/javascripts/app/views/header_view.js
+++ b/public/javascripts/app/views/header_view.js
@@ -2,6 +2,8 @@ app.views.Header = app.views.Base.extend({
template_name : "#header-template",
+ tagName : "header",
+
events : {
"click ul.dropdown li:first-child" : "toggleDropdown"
},
diff --git a/public/javascripts/app/views/likes_info_view.js b/public/javascripts/app/views/likes_info_view.js
index 32302e841..9af8ed0ad 100644
--- a/public/javascripts/app/views/likes_info_view.js
+++ b/public/javascripts/app/views/likes_info_view.js
@@ -2,7 +2,6 @@ app.views.LikesInfo = app.views.StreamObject.extend({
template_name : "#likes-info-template",
- className : "likes_container",
+ className : "likes_container"
- events: { }
});
diff --git a/public/javascripts/app/views/stream_object_view.js b/public/javascripts/app/views/stream_object_view.js
index 271ce3ccf..6a708985b 100644
--- a/public/javascripts/app/views/stream_object_view.js
+++ b/public/javascripts/app/views/stream_object_view.js
@@ -7,7 +7,7 @@ app.views.StreamObject = app.views.Base.extend({
destroyModel: function(evt){
if(evt){ evt.preventDefault(); }
- if(!confirm("Are you sure?")) { return }
+ if(!confirm(Diaspora.I18n.t("confirm_dialog"))) { return }
this.model.destroy();
diff --git a/spec/javascripts/app/views/feedback_view_spec.js b/spec/javascripts/app/views/feedback_view_spec.js
index 5f0a30a94..b9d0b8ea2 100644
--- a/spec/javascripts/app/views/feedback_view_spec.js
+++ b/spec/javascripts/app/views/feedback_view_spec.js
@@ -2,6 +2,13 @@ describe("app.views.Feedback", function(){
beforeEach(function(){
window.current_user = app.user({id : -1, name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
+ Diaspora.I18n.loadLocale({stream : {
+ 'like' : "Like",
+ 'unlike' : "Unlike",
+ 'public' : "Public",
+ 'limited' : "Limted"
+ }})
+
var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"];
this.post = new app.models.Post(posts[0]);
@@ -25,7 +32,7 @@ describe("app.views.Feedback", function(){
context("when the user likes the post", function(){
it("the like action should be 'Unlike'", function(){
- expect(this.link().text()).toContain('Unlike');
+ expect(this.link().text()).toContain(Diaspora.I18n.t('stream.unlike'))
})
})
@@ -37,17 +44,17 @@ describe("app.views.Feedback", function(){
})
it("the like action should be 'Like'", function(){
- expect(this.link().text()).toContain('Like');
+ expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'))
})
it("allows for unliking a just-liked post", function(){
- expect(this.link().text()).toContain('Like');
+ expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'))
this.link().click();
- expect(this.link().text()).toContain('Unlike');
+ expect(this.link().text()).toContain(Diaspora.I18n.t('stream.unlike'))
this.link().click();
- expect(this.link().text()).toContain('Like');
+ expect(this.link().text()).toContain(Diaspora.I18n.t('stream.like'))
})
})
})
@@ -59,7 +66,7 @@ describe("app.views.Feedback", function(){
})
it("shows 'Public'", function(){
- expect($(this.view.el).html()).toContain('Public')
+ expect($(this.view.el).html()).toContain(Diaspora.I18n.t('stream.public'))
})
it("shows a reshare_action link", function(){
@@ -82,7 +89,7 @@ describe("app.views.Feedback", function(){
})
it("shows 'Limited'", function(){
- expect($(this.view.el).html()).toContain('Limited')
+ expect($(this.view.el).html()).toContain(Diaspora.I18n.t('stream.limited'))
})
it("does not show a reshare_action link", function(){
diff --git a/spec/javascripts/app/views/likes_info_spec.js b/spec/javascripts/app/views/likes_info_spec.js
index 44428aef4..e35d2a3bb 100644
--- a/spec/javascripts/app/views/likes_info_spec.js
+++ b/spec/javascripts/app/views/likes_info_spec.js
@@ -2,6 +2,13 @@ describe("app.views.LikesInfo", function(){
beforeEach(function(){
window.current_user = app.user({id : -1, name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
+ Diaspora.I18n.loadLocale({stream : {
+ likes : {
+ zero : "<%= count %> Likes",
+ one : "<%= count %> Like"}
+ }
+ })
+
var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"];
this.post = new app.models.Post(posts[0]); // post with a like
this.view = new app.views.LikesInfo({model: this.post});
@@ -11,7 +18,7 @@ describe("app.views.LikesInfo", function(){
it("displays a the like count if it is above zero", function() {
this.view.render();
- expect($(this.view.el).text()).toContain(this.view.model.get("likes_count"))
+ expect($(this.view.el).text()).toContain(Diaspora.I18n.t('stream.likes', {count : this.view.model.get("likes_count")}))
})
it("does not display the like count if it is zero", function() {
diff --git a/spec/javascripts/app/views/post_view_spec.js b/spec/javascripts/app/views/post_view_spec.js
index a757d98ea..235241bec 100644
--- a/spec/javascripts/app/views/post_view_spec.js
+++ b/spec/javascripts/app/views/post_view_spec.js
@@ -2,10 +2,16 @@ describe("app.views.Post", function(){
describe("#render", function(){
beforeEach(function(){
- // should be jasmine helper
window.current_user = app.user({name: "alice", avatar : {small : "http://avatar.com/photo.jpg"}});
- var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"][0];
+ Diaspora.I18n.loadLocale({stream : {
+ reshares : {
+ one : "<%= count %> reshare",
+ few : "<%= count %> reshares"
+ }
+ }})
+
+ var posts = $.parseJSON(spec.readFixture("multi_stream_json"))["posts"];
this.collection = new app.collections.Stream(posts);
this.statusMessage = this.collection.models[0];
@@ -14,17 +20,15 @@ describe("app.views.Post", function(){
it("displays a reshare count", function(){
this.statusMessage.set({reshares_count : 2})
var view = new app.views.Post({model : this.statusMessage}).render();
- var statusElement = $(view.el)
- expect(statusElement.html()).toContain("2 reshares")
+ expect(view.$(".post_initial_info").html()).toContain(Diaspora.I18n.t('stream.reshares', {count: 2}))
})
it("does not display a reshare count for 'zero'", function(){
this.statusMessage.set({reshares_count : 0})
var view = new app.views.Post({model : this.statusMessage}).render();
- var statusElement = $(view.el)
- expect(statusElement.html()).not.toContain("0 reshares")
+ expect(view.$(".post_initial_info").html()).not.toContain("0 Reshares")
})
context("user not signed in", function(){