]> git.openstreetmap.org Git - rails.git/commitdiff
i18n for messages
authorAndy Allan <gravitystorm@gmail.com>
Sun, 31 May 2009 15:37:18 +0000 (15:37 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Sun, 31 May 2009 15:37:18 +0000 (15:37 +0000)
app/views/message/_message_summary.rhtml
app/views/message/_sent_message_summary.rhtml
app/views/message/inbox.rhtml
app/views/message/new.rhtml
app/views/message/no_such_user.rhtml
app/views/message/outbox.rhtml
app/views/message/read.rhtml
config/locales/en.yml

index 263e30e64089d2b93e25bd29d89b8bdac848ae70..129204d2d845c111e93c8f190cc27bdd451660c3 100644 (file)
@@ -4,11 +4,11 @@
 <tr class="inbox-row<%= "-unread" if not message_summary.message_read? %>">
   <td class="inbox-sender" bgcolor="<%= this_colour %>"><%= link_to h(message_summary.sender.display_name), :controller => 'user', :action => message_summary.sender.display_name %></td>
   <td class="inbox-subject" bgcolor="<%= this_colour %>"><%= link_to h(message_summary.title), :controller => 'message', :action => 'read', :message_id => message_summary.id  %></td>
-  <td class="inbox-sent" bgcolor="<%= this_colour %>"><%= message_summary.sent_on %></td>
+  <td class="inbox-sent" bgcolor="<%= this_colour %>"><%= message_summary.sent_on %></td>
   <% if message_summary.message_read? %>
-    <td><%= button_to 'Mark as unread', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread' %></td>
+    <td><%= button_to t('message.message_summary.unread_button'), :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread' %></td>
   <% else %>
-    <td><%= button_to 'Mark as read', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read' %></td>
+    <td><%= button_to t('message.message_summary.read_button'), :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read' %></td>
   <% end %>
-  <td><%= button_to 'Reply', :controller => 'message', :action => 'reply', :message_id => message_summary.id %></td>
+  <td><%= button_to t('message.message_summary.reply_button'), :controller => 'message', :action => 'reply', :message_id => message_summary.id %></td>
 </tr>
index 91fafe901347fbb0aed847c2f328523a645e4ee4..a03074e0838fa9f93793cef8ac8606cf4a9dccd9 100644 (file)
@@ -4,5 +4,5 @@
 <tr class="inbox-row">
   <td class="inbox-sender" bgcolor="<%= this_colour %>"><%= link_to h(sent_message_summary.recipient.display_name), :controller => 'user', :action => sent_message_summary.recipient.display_name %></td>
   <td class="inbox-subject" bgcolor="<%= this_colour %>"><%= link_to h(sent_message_summary.title), :controller => 'message', :action => 'read', :message_id => sent_message_summary.id  %></td>
-  <td class="inbox-sent" bgcolor="<%= this_colour %>"><%= sent_message_summary.sent_on %></td>
+  <td class="inbox-sent" bgcolor="<%= this_colour %>"><%= sent_message_summary.sent_on %></td>
 </tr>
index 2a64f2774788d7b81b0bfd343d82413a23bd3dce..38fe8495b7aa89e7bca7aaf953316ca96087e6c7 100644 (file)
@@ -1,14 +1,14 @@
-<h2>My inbox/<%= link_to "outbox", url_for(:controller => "user", :action => "outbox", :id => @user.display_name) %></h2>
+<h2><%= t'message.inbox.my_inbox'%>/<%= link_to t('message.inbox.outbox'), url_for(:controller => "user", :action => "outbox", :id => @user.display_name) %></h2>
 
-<p>You have <%= @user.new_messages.size %> new messages and <%= @user.messages.size -  @user.new_messages.size %> old messages</p> 
+<p><%= t'message.inbox.you_have', :new_count => @user.new_messages.size, :old_count => (@user.messages.size -  @user.new_messages.size) %></p> 
 
 <% if @user.messages.size > 0 %>
   <div id="messages">
     <table class="messages">
       <tr>
-        <th>From</th>
-        <th>Subject</th>
-        <th>Date</th>
+        <th><%= t'message.inbox.from' %></th>
+        <th><%= t'message.inbox.subject' %></th>
+        <th><%= t'message.inbox.date' %></th>
         <th></th>
         <th></th>
       </tr>
@@ -16,5 +16,5 @@
     </table>
   </div>
 <% else %>
-         <div id="messages">You have no messages yet. Why not get in touch with some of the <%= link_to 'people mapping nearby', :controller => 'user', :action => 'view', :display_name => @user.display_name %>?</div>
+         <div id="messages"><%= t'message.inbox.no_messages_yet', :people_mapping_nearby_link => link_to(t('message.inbox.people_mapping_nearby'), :controller => 'user', :action => 'view', :display_name => @user.display_name) %></div>
 <% end %>
index 17f3588bb47b4b3a6668a0c06111066eea6674b5..a356692c8f000e3973c1a7890a74e1ac94bcb830 100644 (file)
@@ -1,29 +1,24 @@
-<h2>Send a new message to <%= h(@to_user.display_name) %></h2>
-
-<% if params[:display_name] %>
-<p>Writing a new message to <%= h(params[:display_name]) %></p>  
-<p>TODO: drop down box of your friends</p>
-<%end%>
+<h2><%= t'message.new.send_message_to', :name => h(@to_user.display_name) %></h2>
 
 <%= error_messages_for 'message' %>
 
 <% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %>
   <table>
     <tr valign="top">
-      <th>Subject</th>
+      <th><%= t'message.new.subject' %></th>
       <td><%= f.text_field :title, :size => 60, :value => @title %></td>
     </tr>
     <tr valign="top">
-      <th>Body</th>
+      <th><%= t'message.new.body' %></th>
       <td><%= f.text_area :body, :cols => 80, :value => @body %></td>
     </tr>
     <tr>
       <th></th>
-      <td><%= submit_tag 'Send' %></td>
+      <td><%= submit_tag t('message.new.send_button') %></td>
     </tr>
   </table>
 <% end %>
 
 <br />
 
-<%= link_to 'Back to inbox', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>
+<%= link_to t('message.new.back_to_inbox'), :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>
index c18733af6d48fd37dd41f88d6025f2e963c636b9..0d9ba66aae008353ab1a4c9022882cbac89f2971 100644 (file)
@@ -1,2 +1,2 @@
-<h1>No such user or message</h1>
-<p>Sorry there is no user or message with that name or id</p>
+<h1><%= t'message.no_such_user.no_such_user' %></h1>
+<p><%= t'message.no_such_user.sorry' %></p>
index 6fcbdfa2161d69fe0c596bd3ec970c3503c197f9..3e6346c9ab90398ba5485ad1ac550d14f460d07a 100644 (file)
@@ -1,18 +1,18 @@
-<h2>My <%= link_to "inbox", url_for(:controller => "user", :action => "inbox", :id => @user.display_name) %>/outbox</h2>
+<h2><%= 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>You have <%= @user.sent_messages.size %> sent messages
+<p><%= t'message.outbox.you_have_sent_messages', :sent_count => @user.sent_messages.size %>
 
 <% if @user.sent_messages.size > 0 %>
   <div id="messages">
     <table class="messages">
       <tr>
-        <th>To</th>
-        <th>Subject</th>
-        <th>Date</th>
+        <th><%= t'message.outbox.to' %></th>
+        <th><%= t'message.outbox.subject' %></th>
+        <th><%= t'message.outbox.date' %></th>
       </tr>
       <%= render :partial => "sent_message_summary", :collection => @user.sent_messages %>
     </table>
   </div>
 <% else %>
-         <div id="messages">You have no sent messages yet. Why not get in touch with some of the <%= link_to 'people mapping nearby', :controller => 'user', :action => 'view', :display_name => @user.display_name %>?</div>
+         <div id="messages"><%= t'message.outbox.no_sent_messages', :people_mapping_nearby_link => link_to(t('message.outbox.people_mapping_nearby'), :controller => 'user', :action => 'view', :display_name => @user.display_name) %></div>
 <% end %>
index d44859029dea35f7cadda8002239b8120943d419..8a7b6b1563c235340f6969e42a320f5b53b3497e 100644 (file)
@@ -1,10 +1,10 @@
 <% if @user == @message.recipient %>
 
-<h2>Reading your messages</h2>
+<h2><%= t'message.read.reading_your_messages' %></h2>
 
 <table>
   <tr>
-    <th align="right">From</th>
+    <th align="right"><%= t'message.read.from' %></th>
     <td>
      <% if @message.sender.image %>
         <%= image_tag url_for_file_column(@message.sender, "image") %>
 <%= link_to h(@message.sender.display_name), :controller => 'user', :action => 'view', :display_name => @message.sender.display_name %></td>
   </tr>
   <tr>
-    <th align="right">Subject</th>
+    <th align="right"><%= t'message.read.subject' %></th>
     <td><%= h(@message.title) %></td>
   </tr>
   <tr>
-    <th align="right">Date</th>
-    <td><%= @message.sent_on %></td>
+    <th align="right"><%= t'message.read.date' %></th>
+    <td><%= @message.sent_on %></td>
   </tr>
   <tr>
     <th></th>
 
 <table>
   <tr>
-    <td><%= button_to 'Reply', :controller => 'message', :action => 'reply', :message_id => @message.id %></td>
-    <td><%= button_to 'Mark as unread', :controller => 'message', :action => 'mark', :message_id => @message.id, :mark => 'unread' %></td>
-    <td><%= link_to 'Back to inbox', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %></td>
+    <td><%= button_to t('message.read.reply_button'), :controller => 'message', :action => 'reply', :message_id => @message.id %></td>
+    <td><%= button_to t('message.read.unread_button'), :controller => 'message', :action => 'mark', :message_id => @message.id, :mark => 'unread' %></td>
+    <td><%= link_to t('message.read.back_to_inbox'), :controller => 'message', :action => 'inbox', :display_name => @user.display_name %></td>
   </tr>
 </table>
 
 <% else %>
 
-<h2>Reading your sent messages</h2>
+<h2><%= t'message.read.reading_your_sent_messages' %></h2>
 
 <table>
   <tr>
-    <th align="right">To</th>
+    <th align="right"><%= t'message.read.to' %></th>
     <td><%= link_to h(@message.recipient.display_name), :controller => 'user', :action => 'view', :display_name => @message.recipient.display_name %></td>
   </tr>
   <tr>
-    <th align="right">Subject</th>
+    <th align="right"><%= t'message.read.subject' %></th>
     <td><%= h(@message.title) %></td>
   </tr>
   <tr>
-    <th align="right">Date</th>
-    <td><%= @message.sent_on %></td>
+    <th align="right"><%= t'message.read.date' %></th>
+    <td><%= @message.sent_on %></td>
   </tr>
   <tr>
     <th></th>
@@ -63,7 +63,7 @@
 
 <table>
   <tr>
-    <td><%= link_to 'Back to outbox', :controller => 'message', :action => 'outbox', :display_name => @user.display_name %></td>
+    <td><%= link_to t('message.read.back_to_outbox'), :controller => 'message', :action => 'outbox', :display_name => @user.display_name %></td>
   </tr>
 </table>
 
index c3662c220d402ede0a432bc3c724b04526bed3b8..c337ae5aa977581fb984595b94631be875b81ced 100644 (file)
@@ -235,6 +235,50 @@ en:
     shop: Shop
     sotm: 'Come to the 2009 OpenStreetMap Conference, The State of the Map, July 10-12 in Amsterdam!'
     alt_donation: Make a Donation
+  message:
+    inbox:
+      my_inbox: "My inbox"
+      outbox: "outbox"
+      you_have: "You have {{new_count}} new messages and {{old_count}} old messages"
+      from: "From"
+      subject: "Subject"
+      date: "Date"
+      no_messages_yet: "You have no messages yet. Why not get in touch with some of the {{people_mapping_nearby_link}}?"
+      people_mapping_nearby: "people mapping nearby" 
+    message_summary:
+      unread_button: "Mark as unread"
+      read_button: "Mark as read"
+      reply_button: "Reply"
+    new:
+      send_message_to: "Send a new message to {{name}}"
+      subject: "Subject"
+      body: "Body"
+      send_button: "Send"
+      back_to_inbox: "Back to inbox"
+    no_such_user:
+      no_such_user: "No such user or message"
+      sorry: "Sorry there is no user or message with that name or id"
+    outbox: 
+      my_inbox: "My {{inbox_link}}"
+      inbox: "inbox"
+      outbox: "outbox"
+      you_have_sent_messages: "You have {{sent_count}} sent messages"
+      to: "To"
+      subject: "Subject"
+      date: "Date"
+      no_sent_messages: "You have no sent messages yet. Why not get in touch with some of the {{people_mapping_nearby_link}}?"
+      people_mapping_nearby: "people mapping nearby"
+    read:
+      reading_your_messages: "Reading your messages"
+      from: "From"
+      subject: "Subject"
+      date: "Date"
+      reply_button: "Reply"
+      unread_button: "Mark as unread"
+      back_to_inbox: "Back to inbox"
+      reading_your_sent_messages: "Reading your sent messages"
+      to: "To"
+      back_to_outbox: "Back to outbox"
   site:
     index:
       js_1: "You are either using a browser that doesn't support javascript, or you have disabled javascript."