Pluralize message counts properly
authorTom Hughes <tom@compton.nu>
Sat, 14 Jan 2012 12:19:40 +0000 (12:19 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 14 Jan 2012 12:19:40 +0000 (12:19 +0000)
app/views/message/_message_count.html.erb
app/views/message/outbox.html.erb
config/locales/en.yml

index 27b0aa644f0f58cf6e7446b73ef929737164e618..9b5edd26cf3cfad0251d2f6f3664362b2fc392d3 100644 (file)
@@ -1 +1,8 @@
-<p id="inbox-count"><%= t'message.inbox.you_have', :new_count => @user.new_messages.size, :old_count => (@user.messages.size -  @user.new_messages.size) %></p> 
+<p id="inbox-count">
+<%= t "message.inbox.messages",
+      :new_messages => t("message.inbox.new_messages", 
+                         :count => @user.new_messages.size),
+      :old_messages => t("message.inbox.old_messages", 
+                         :count => @user.messages.size - @user.new_messages.size)
+%>
+</p> 
index 9662fdbce397b13076f31dadc325a10aed8fa567..fd89581262a323b2f851cf53d6be3c3c6f4f956b 100644 (file)
@@ -1,6 +1,6 @@
 <h2><%= raw(t'message.outbox.my_inbox', :inbox_link => link_to(t('message.outbox.inbox'), url_for(:controller => "user", :action => "inbox", :id => @user.display_name))) %>/<%= t'message.outbox.outbox' %></h2>
 
-<p><%= t'message.outbox.you_have_sent_messages', :count => @user.sent_messages.size %>
+<p><%= t'message.outbox.messages', :count => @user.sent_messages.size %>
 
 <% if @user.sent_messages.size > 0 %>
   <div id="messages">
index 0347d6fd70262e350631f72fdb5b51da464e0740..bd467cb7b9a3b2f138040278a484cdc38c4c277d 100644 (file)
@@ -1187,7 +1187,13 @@ en:
       title: "Inbox"
       my_inbox: "My inbox"
       outbox: "outbox"
-      you_have: "You have %{new_count} new messages and %{old_count} old messages"
+      messages: "You have %{new_messages} and %{old_messages}"
+      new_messages:
+        one: "%{count} new message"
+        other: "%{count} new messages"
+      old_messages:
+        one: "%{count} old message"
+        other: "%{count} old messages"
       from: "From"
       subject: "Subject"
       date: "Date"
@@ -1220,7 +1226,9 @@ en:
       my_inbox: "My %{inbox_link}"
       inbox: "inbox"
       outbox: "outbox"
-      you_have_sent_messages: "You have %{count} sent messages"
+      messages:
+        one: "You have %{count} sent message"
+        other: "You have %{count} sent messages"
       to: "To"
       subject: "Subject"
       date: "Date"