From: Andy Allan Date: Sun, 31 May 2009 15:37:18 +0000 (+0000) Subject: i18n for messages X-Git-Tag: live~7339^2~11 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/272d73e9a76ff55a05a0889bd02a9e3c31a35910 i18n for messages --- diff --git a/app/views/message/_message_summary.rhtml b/app/views/message/_message_summary.rhtml index 263e30e64..129204d2d 100644 --- a/app/views/message/_message_summary.rhtml +++ b/app/views/message/_message_summary.rhtml @@ -4,11 +4,11 @@ "> <%= link_to h(message_summary.sender.display_name), :controller => 'user', :action => message_summary.sender.display_name %> <%= link_to h(message_summary.title), :controller => 'message', :action => 'read', :message_id => message_summary.id %> - <%= message_summary.sent_on %> + <%= l message_summary.sent_on %> <% if message_summary.message_read? %> - <%= button_to 'Mark as unread', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread' %> + <%= button_to t('message.message_summary.unread_button'), :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread' %> <% else %> - <%= button_to 'Mark as read', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read' %> + <%= button_to t('message.message_summary.read_button'), :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read' %> <% end %> - <%= button_to 'Reply', :controller => 'message', :action => 'reply', :message_id => message_summary.id %> + <%= button_to t('message.message_summary.reply_button'), :controller => 'message', :action => 'reply', :message_id => message_summary.id %> diff --git a/app/views/message/_sent_message_summary.rhtml b/app/views/message/_sent_message_summary.rhtml index 91fafe901..a03074e08 100644 --- a/app/views/message/_sent_message_summary.rhtml +++ b/app/views/message/_sent_message_summary.rhtml @@ -4,5 +4,5 @@ <%= link_to h(sent_message_summary.recipient.display_name), :controller => 'user', :action => sent_message_summary.recipient.display_name %> <%= link_to h(sent_message_summary.title), :controller => 'message', :action => 'read', :message_id => sent_message_summary.id %> - <%= sent_message_summary.sent_on %> + <%= l sent_message_summary.sent_on %> diff --git a/app/views/message/inbox.rhtml b/app/views/message/inbox.rhtml index 2a64f2774..38fe8495b 100644 --- a/app/views/message/inbox.rhtml +++ b/app/views/message/inbox.rhtml @@ -1,14 +1,14 @@ -

My inbox/<%= link_to "outbox", url_for(:controller => "user", :action => "outbox", :id => @user.display_name) %>

+

<%= t'message.inbox.my_inbox'%>/<%= link_to t('message.inbox.outbox'), url_for(:controller => "user", :action => "outbox", :id => @user.display_name) %>

-

You have <%= @user.new_messages.size %> new messages and <%= @user.messages.size - @user.new_messages.size %> old messages

+

<%= t'message.inbox.you_have', :new_count => @user.new_messages.size, :old_count => (@user.messages.size - @user.new_messages.size) %>

<% if @user.messages.size > 0 %>
- - - + + + @@ -16,5 +16,5 @@
FromSubjectDate<%= t'message.inbox.from' %><%= t'message.inbox.subject' %><%= t'message.inbox.date' %>
<% else %> -
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 %>?
+
<%= 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) %>
<% end %> diff --git a/app/views/message/new.rhtml b/app/views/message/new.rhtml index 17f3588bb..a356692c8 100644 --- a/app/views/message/new.rhtml +++ b/app/views/message/new.rhtml @@ -1,29 +1,24 @@ -

Send a new message to <%= h(@to_user.display_name) %>

- -<% if params[:display_name] %> -

Writing a new message to <%= h(params[:display_name]) %>

-

TODO: drop down box of your friends

-<%end%> +

<%= t'message.new.send_message_to', :name => h(@to_user.display_name) %>

<%= error_messages_for 'message' %> <% form_for :message, :url => { :action => "new", :user_id => @to_user.id } do |f| %> - + - + - +
Subject<%= t'message.new.subject' %> <%= f.text_field :title, :size => 60, :value => @title %>
Body<%= t'message.new.body' %> <%= f.text_area :body, :cols => 80, :value => @body %>
<%= submit_tag 'Send' %><%= submit_tag t('message.new.send_button') %>
<% end %>
-<%= 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 %> diff --git a/app/views/message/no_such_user.rhtml b/app/views/message/no_such_user.rhtml index c18733af6..0d9ba66aa 100644 --- a/app/views/message/no_such_user.rhtml +++ b/app/views/message/no_such_user.rhtml @@ -1,2 +1,2 @@ -

No such user or message

-

Sorry there is no user or message with that name or id

+

<%= t'message.no_such_user.no_such_user' %>

+

<%= t'message.no_such_user.sorry' %>

diff --git a/app/views/message/outbox.rhtml b/app/views/message/outbox.rhtml index 6fcbdfa21..3e6346c9a 100644 --- a/app/views/message/outbox.rhtml +++ b/app/views/message/outbox.rhtml @@ -1,18 +1,18 @@ -

My <%= link_to "inbox", url_for(:controller => "user", :action => "inbox", :id => @user.display_name) %>/outbox

+

<%= 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' %>

-

You have <%= @user.sent_messages.size %> sent messages +

<%= t'message.outbox.you_have_sent_messages', :sent_count => @user.sent_messages.size %> <% if @user.sent_messages.size > 0 %>

- - - + + + <%= render :partial => "sent_message_summary", :collection => @user.sent_messages %>
ToSubjectDate<%= t'message.outbox.to' %><%= t'message.outbox.subject' %><%= t'message.outbox.date' %>
<% else %> -
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 %>?
+
<%= 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) %>
<% end %> diff --git a/app/views/message/read.rhtml b/app/views/message/read.rhtml index d44859029..8a7b6b156 100644 --- a/app/views/message/read.rhtml +++ b/app/views/message/read.rhtml @@ -1,10 +1,10 @@ <% if @user == @message.recipient %> -

Reading your messages

+

<%= t'message.read.reading_your_messages' %>

- + - + - - + + @@ -30,28 +30,28 @@
From<%= t'message.read.from' %> <% if @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 %>
Subject<%= t'message.read.subject' %> <%= h(@message.title) %>
Date<%= @message.sent_on %><%= t'message.read.date' %><%= l @message.sent_on %>
- - - + + +
<%= button_to 'Reply', :controller => 'message', :action => 'reply', :message_id => @message.id %><%= button_to 'Mark as unread', :controller => 'message', :action => 'mark', :message_id => @message.id, :mark => 'unread' %><%= link_to 'Back to inbox', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %><%= button_to t('message.read.reply_button'), :controller => 'message', :action => 'reply', :message_id => @message.id %><%= button_to t('message.read.unread_button'), :controller => 'message', :action => 'mark', :message_id => @message.id, :mark => 'unread' %><%= link_to t('message.read.back_to_inbox'), :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>
<% else %> -

Reading your sent messages

+

<%= t'message.read.reading_your_sent_messages' %>

- + - + - - + + @@ -63,7 +63,7 @@
To<%= t'message.read.to' %> <%= link_to h(@message.recipient.display_name), :controller => 'user', :action => 'view', :display_name => @message.recipient.display_name %>
Subject<%= t'message.read.subject' %> <%= h(@message.title) %>
Date<%= @message.sent_on %><%= t'message.read.date' %><%= l @message.sent_on %>
- +
<%= link_to 'Back to outbox', :controller => 'message', :action => 'outbox', :display_name => @user.display_name %><%= link_to t('message.read.back_to_outbox'), :controller => 'message', :action => 'outbox', :display_name => @user.display_name %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index c3662c220..c337ae5aa 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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."