i18n for messages

This commit is contained in:
Andy Allan 2009-05-31 15:37:18 +00:00
parent 168036d3a2
commit 272d73e9a7
8 changed files with 82 additions and 43 deletions

View file

@ -4,11 +4,11 @@
<tr class="inbox-row<%= "-unread" if not message_summary.message_read? %>"> <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-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-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 %>"><%= l message_summary.sent_on %></td>
<% if message_summary.message_read? %> <% 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 %> <% 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 %> <% 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> </tr>

View file

@ -4,5 +4,5 @@
<tr class="inbox-row"> <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-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-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 %>"><%= l sent_message_summary.sent_on %></td>
</tr> </tr>

View 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 %> <% if @user.messages.size > 0 %>
<div id="messages"> <div id="messages">
<table class="messages"> <table class="messages">
<tr> <tr>
<th>From</th> <th><%= t'message.inbox.from' %></th>
<th>Subject</th> <th><%= t'message.inbox.subject' %></th>
<th>Date</th> <th><%= t'message.inbox.date' %></th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
@ -16,5 +16,5 @@
</table> </table>
</div> </div>
<% else %> <% 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 %> <% end %>

View file

@ -1,29 +1,24 @@
<h2>Send a new message to <%= h(@to_user.display_name) %></h2> <h2><%= t'message.new.send_message_to', :name => 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%>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %> <% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %>
<table> <table>
<tr valign="top"> <tr valign="top">
<th>Subject</th> <th><%= t'message.new.subject' %></th>
<td><%= f.text_field :title, :size => 60, :value => @title %></td> <td><%= f.text_field :title, :size => 60, :value => @title %></td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<th>Body</th> <th><%= t'message.new.body' %></th>
<td><%= f.text_area :body, :cols => 80, :value => @body %></td> <td><%= f.text_area :body, :cols => 80, :value => @body %></td>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
<td><%= submit_tag 'Send' %></td> <td><%= submit_tag t('message.new.send_button') %></td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
<br /> <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 %>

View file

@ -1,2 +1,2 @@
<h1>No such user or message</h1> <h1><%= t'message.no_such_user.no_such_user' %></h1>
<p>Sorry there is no user or message with that name or id</p> <p><%= t'message.no_such_user.sorry' %></p>

View 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 %> <% if @user.sent_messages.size > 0 %>
<div id="messages"> <div id="messages">
<table class="messages"> <table class="messages">
<tr> <tr>
<th>To</th> <th><%= t'message.outbox.to' %></th>
<th>Subject</th> <th><%= t'message.outbox.subject' %></th>
<th>Date</th> <th><%= t'message.outbox.date' %></th>
</tr> </tr>
<%= render :partial => "sent_message_summary", :collection => @user.sent_messages %> <%= render :partial => "sent_message_summary", :collection => @user.sent_messages %>
</table> </table>
</div> </div>
<% else %> <% 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 %> <% end %>

View file

@ -1,10 +1,10 @@
<% if @user == @message.recipient %> <% if @user == @message.recipient %>
<h2>Reading your messages</h2> <h2><%= t'message.read.reading_your_messages' %></h2>
<table> <table>
<tr> <tr>
<th align="right">From</th> <th align="right"><%= t'message.read.from' %></th>
<td> <td>
<% if @message.sender.image %> <% if @message.sender.image %>
<%= image_tag url_for_file_column(@message.sender, "image") %> <%= image_tag url_for_file_column(@message.sender, "image") %>
@ -13,12 +13,12 @@
<%= link_to h(@message.sender.display_name), :controller => 'user', :action => 'view', :display_name => @message.sender.display_name %></td> <%= link_to h(@message.sender.display_name), :controller => 'user', :action => 'view', :display_name => @message.sender.display_name %></td>
</tr> </tr>
<tr> <tr>
<th align="right">Subject</th> <th align="right"><%= t'message.read.subject' %></th>
<td><%= h(@message.title) %></td> <td><%= h(@message.title) %></td>
</tr> </tr>
<tr> <tr>
<th align="right">Date</th> <th align="right"><%= t'message.read.date' %></th>
<td><%= @message.sent_on %></td> <td><%= l @message.sent_on %></td>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
@ -30,28 +30,28 @@
<table> <table>
<tr> <tr>
<td><%= button_to 'Reply', :controller => 'message', :action => 'reply', :message_id => @message.id %></td> <td><%= button_to t('message.read.reply_button'), :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><%= button_to t('message.read.unread_button'), :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><%= link_to t('message.read.back_to_inbox'), :controller => 'message', :action => 'inbox', :display_name => @user.display_name %></td>
</tr> </tr>
</table> </table>
<% else %> <% else %>
<h2>Reading your sent messages</h2> <h2><%= t'message.read.reading_your_sent_messages' %></h2>
<table> <table>
<tr> <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> <td><%= link_to h(@message.recipient.display_name), :controller => 'user', :action => 'view', :display_name => @message.recipient.display_name %></td>
</tr> </tr>
<tr> <tr>
<th align="right">Subject</th> <th align="right"><%= t'message.read.subject' %></th>
<td><%= h(@message.title) %></td> <td><%= h(@message.title) %></td>
</tr> </tr>
<tr> <tr>
<th align="right">Date</th> <th align="right"><%= t'message.read.date' %></th>
<td><%= @message.sent_on %></td> <td><%= l @message.sent_on %></td>
</tr> </tr>
<tr> <tr>
<th></th> <th></th>
@ -63,7 +63,7 @@
<table> <table>
<tr> <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> </tr>
</table> </table>

View file

@ -235,6 +235,50 @@ en:
shop: Shop shop: Shop
sotm: 'Come to the 2009 OpenStreetMap Conference, The State of the Map, July 10-12 in Amsterdam!' sotm: 'Come to the 2009 OpenStreetMap Conference, The State of the Map, July 10-12 in Amsterdam!'
alt_donation: Make a Donation 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: site:
index: index:
js_1: "You are either using a browser that doesn't support javascript, or you have disabled javascript." js_1: "You are either using a browser that doesn't support javascript, or you have disabled javascript."