From 9aec18155b821fa88e9948b00d8356c79ccdfa6e Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Tue, 15 Nov 2016 14:40:55 +0100 Subject: [PATCH] i18n of users/{list,show,tree} --- app/views/users/_invitationform.html.erb | 8 +-- app/views/users/list.html.erb | 4 +- app/views/users/show.html.erb | 79 ++++++++++++------------ app/views/users/tree.html.erb | 6 +- config/locales/en.yml | 57 +++++++++++++++-- config/locales/fr.yml | 57 +++++++++++++++-- 6 files changed, 150 insertions(+), 61 deletions(-) diff --git a/app/views/users/_invitationform.html.erb b/app/views/users/_invitationform.html.erb index 634538b..3e78ec7 100644 --- a/app/views/users/_invitationform.html.erb +++ b/app/views/users/_invitationform.html.erb @@ -1,5 +1,5 @@

-<%= raw(t('.invitationtext')) %> +<%=raw(t(:invitationtext)) %>

<%= form_tag "/invitations", :method => :post do |f| %> @@ -8,18 +8,18 @@ <% end %>
- <%= label_tag :email, t('.emailaddress'), :class => "required" %> + <%= label_tag :email, t(:emailaddress), :class => "required" %> <%= text_field_tag :email, "", :size => 30, :autocomplete => "off" %>
- <%= label_tag :memo, t('.memouser'), :class => "required" %> + <%= label_tag :memo, t(:memouser), :class => "required" %> <%= text_field_tag :memo, "", :size => 60 %>

- <%= submit_tag t('.sendinvitation') %> + <%= submit_tag t(:sendinvitation) %>
<% end %> diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index da2687d..3815cbe 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -14,11 +14,11 @@ <% end %> ><%= user.username %> <% if user.is_admin? %> - (administrator) + <%= t('.moderator') %> <% else %> (<%= user.karma %>) <% if user.is_moderator? %> - (moderator) + <%= t('.administrator') %> <% end %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ac37d72..025cec0 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -11,7 +11,7 @@ <% if @user && @showing_user.is_active? %> - (Send a Message) + (<%= t('.sendmessage') %>) <% end %> @@ -23,33 +23,33 @@ <% end %> - + > <% if @showing_user.is_banned? %> - Banned user + <%= t('.banneduser') %> <% elsif !@showing_user.is_active? %> - Inactive user + <%= t('.inactiveuser') %> <% else %> - Active - <%= @showing_user.is_admin? ? "administrator" : - (@showing_user.is_moderator? ? "moderator" : "user") %> + <%= t('.active') %> + <%= @showing_user.is_admin? ? t('.administrator') : + (@showing_user.is_moderator? ? t('.moderator') : t('.user')) %> <% if !@showing_user.can_invite? %> - with invites + <%= t('.withinvites') %> <% if !@showing_user.can_submit_stories? %> - and story submissions + <%= t('.storysubmissions') %> <% end %> - disabled + <%= t('.disabled') %> <% end %> <% end %>
- + - <%= time_ago_in_words_label(@showing_user.created_at) %> + <%= distance_of_time_in_words(@showing_user.created_at, Time.now) %> <% if @showing_user.invited_by_user %> - by invitation from + <%= t('.byinvitationfrom') %> <%= link_to @showing_user.invited_by_user.try(:username), @showing_user.invited_by_user %> <% end %> @@ -57,11 +57,11 @@
<% if @showing_user.is_banned? %> - + - <%= time_ago_in_words_label(@showing_user.banned_at) %> + <%= distance_of_time_in_words(@showing_user.banned_at, Time.now) %> <% if @showing_user.banned_by_user %> - by <%= link_to @showing_user.banned_by_user.try(:username), + <%= t('.bannedby') %><%= link_to @showing_user.banned_by_user.try(:username), @showing_user.banned_by_user %>: <%= @showing_user.banned_reason %> <% end %> @@ -70,7 +70,7 @@ <% end %> <% if @showing_user.hats.any? %> - + <% @showing_user.hats.each do |hat| %> <%= hat.to_html_label %> @@ -80,37 +80,37 @@ <% end %> <% if @showing_user.deleted_at? %> - + - <%= time_ago_in_words_label(@showing_user.deleted_at) %> + <%= distance_of_time_in_words(@showing_user.deleted_at, Time.now) %>
<% end %> <% if !@showing_user.is_admin? %> - + - <%= @showing_user.karma %>, averaging <%= + <%= @showing_user.karma %><%= t('.karmaaverage') %><%= number_with_precision(@showing_user.average_karma, :precision => 2) %> - per story/comment + <%= t('.karmaperstorycomment') %>
<% end %> - + <% tag = @showing_user.most_common_story_tag %> <%= @showing_user.stories_submitted_count %><%= tag ? ", " : "" %> <% if tag %> - most commonly tagged <%= tag.tag %> <% end %>
- + <%= @showing_user.comments_posted_count %> @@ -118,13 +118,13 @@
<% if @showing_user.is_active? %> - +
<% if @showing_user.about.present? %> <%= raw @showing_user.linkified_about %> <% else %> - A mystery... + <%= t('.aboutdefault') %> <% end %>
<% end %> @@ -135,17 +135,17 @@

- Administrative Information + <%= t('.administrativeinfo') %>

- + <%= @showing_user.email %>
- +
<% @showing_user.votes_for_others.limit(10).each do |v| %>

@@ -161,7 +161,7 @@ <% end %> on <% if v.comment_id %> - comment + <%= t('.commentlinktext') %> by <%= v.comment.user.try(:username) %> @@ -183,31 +183,30 @@

- Administrative Actions + <%= t('.administrativeactions') %>

<% if @showing_user.is_banned? %> <%= form_tag user_unban_path, :method => :post do %>

- <%= submit_tag "Unban User" %> + <%= submit_tag t('unbanuser') %>

<% end %> <% else %>

- Banning or disabling invites for a user will send an e-mail to the user with the reason below, - with your e-mail address as the Reply-To so the user can respond. + <%= t('.banningdescription') %>

<%= form_tag user_ban_path, :method => :post do %>

- <%= label_tag :reason, "Reason:", :class => "required" %> + <%= label_tag :reason, t('.banningreason'), :class => "required" %> <%= text_field_tag :reason, "", :size => 40 %>

- <%= submit_tag "Ban User" %> + <%= submit_tag t('.banuserbutton') %>

<% end %> <% end %> @@ -215,7 +214,7 @@ <% if @showing_user.banned_from_inviting? %> <%= form_tag user_enable_invite_path, :method => :post do %>

- <%= submit_tag "Enable invitations for User" %> + <%= submit_tag t('.enableinvitesforuser') %>

<% end %> <% else %> @@ -223,12 +222,12 @@

- <%= label_tag :reason, "Reason:", :class => "required" %> + <%= label_tag :reason, t('.disableinvitesreason'), :class => "required" %> <%= text_field_tag :reason, "", :size => 40 %>

- <%= submit_tag "Disable invites" %> + <%= submit_tag t('.disableinvitesbutton') %>

<% end %> <% end %> diff --git a/app/views/users/tree.html.erb b/app/views/users/tree.html.erb index fde3e92..17843cf 100644 --- a/app/views/users/tree.html.erb +++ b/app/views/users/tree.html.erb @@ -4,7 +4,7 @@

- Newest users: + <%= t('.newestusers') %> <%= raw @newest.map{|u| "#{u.username} " << "(#{u.karma})" }.join(", ") %> @@ -26,11 +26,11 @@ <% end %> ><%= user.username %> <% if user.is_admin? %> - (administrator) + <%= t('.administrator') %> <% else %> (<%= user.karma %>) <% if user.is_moderator? %> - (moderator) + <%= t('.moderator') %>(moderator) <% end %> <% end %> <% if (children = @users_by_parent[user.id]) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index f19ca9b..ace09b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -173,12 +173,6 @@ en: accountnolongersetuppushover: "Your account is no longer setup for Pushover notifications." update: updatesettingsflash: "Successfully updated settings." - users: - invitationform: - invitationtext: "Invitations are unlimited, but persons you invite will be associated with your account in the user tree and you may be responsible for them if they cause problems. Please use your discretion when inviting persons you don't personally know." - emailaddress: "E-mail Address:" - memouser: "Memo to User:" - sendinvitation: "Send Invitation" stories: edit: edit: "Edit Story" @@ -239,3 +233,54 @@ en: preview: "Preview" submit: "Submit a Story" submitbutton: "Submit" + users: + list: + administrator: "administrator" + moderator: "moderator" + show: + status: "Status:" + sendmessage: "Send a Message" + banned: "Banned user" + inactive: "Inactive user" + active: "Active " + administrator: "administrator" + moderator: "moderator" + user: "user" + withinvites: "with invites" + storysubmissions: "with story submissions" + disabled: "disabled" + joined: "Joined:" + byinvitationfrom: "by invitation from" + banneduser: "Banned:" + bannedby: "by" + hats: "Hats:" + left: "Parti :" + karma: "Karma :" + karmaaverage: ", averaging " + karmaperstorycomment: "per story/comment" + storiessubmitted: "Stories Submitted:" + postedcomments: "Posted Comments:" + mostcommonlytagged: "most commonly tagged " + about: "About:" + aboutdefault: "A mystery..." + administrativeinfo: "Administrative Information" + email: "E-mail:" + recentvotes: "Recent Votes:" + commentlinktext: "comment" + administrativeactions: "Administrative Actions" + unbanuser: "Unban User" + banningdescription: "Banning or disabling invites for a user will send an e-mail to the user with the reason below, with your e-mail address as the Reply-To so the user can respond." + banningreason: "Reason:" + banuserbutton: "Ban User" + enableinvitesforuser: "Enable invitations for User" + disableinvitesreason: "Reason:" + disableinvitesbutton: "Disable invites" + tree: + newestusers: "Newest users:" + administrator: "(administrator)" + moderator: "(moderator)" +# data for users/invitationform which is a partial view + invitationtext: "Invitations are unlimited, but persons you invite will be associated with your account in the user tree and you may be responsible for them if they cause problems. Please use your discretion when inviting persons you don't personally know." + emailaddress: "E-mail Address:" + memouser: "Memo to User:" + sendinvitation: "Send Invitation" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 4766e71..41e8372 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -185,12 +185,6 @@ fr: accountnolongersetuppushover: "Votre compte n'est plus configuré pour les notifications Pushover." update: updatesettingsflash: "Paramètres mis à jour avec succès." - users: - invitationform: - invitationtext: "Le nombre d'invitations est illimité, mais les personnes que vous invitez sont associées à votre compte dans l'arbre des utilisateurs et vous pourriez être tenu pour responsable s'ils causent des problèmes. Merci d'évaluer le fait d'inviter des gens que vous ne connaissez pas personnellement." - emailaddress: "Adresse e-mail :" - memouser: "Message à l'utilisateur :" - sendinvitation: "Envoyer l'invitation" stories: edit: edit: "Éditer l'info" @@ -251,6 +245,57 @@ fr: preview: "Aperçu" submit: "Soumettre une info" submitbutton: "Soumettre" + users: + list: + administrator: "administrateur" + moderator: "modérateur" + show: + status: "Statut :" + sendmessage: "Envoyer un message" + banned: "Utilisateur banni" + inactive: "Utilisateur inactif" + active: "actif " + administrator: "administrateur" + moderator: "modérateur" + user: "utilisateur" + withinvites: "avec invitations" + storysubmissions: "avec propositions d'infos" + disabled: "désactivé" + joined: "Joint :" + byinvitationfrom: "par invitation de" + banneduser: "Banni :" + bannedby: "par" + hats: "Chapeaux :" + left: "Parti :" + karma: "Karma :" + karmaaverage: ", en moyenne " + karmaperstorycomment: "par info/commentaire" + storiessubmitted: "Infos soumises :" + postedcomments: "Commentaires postés :" + mostcommonlytagged: "le plus couramment marquées " + about: "À propos :" + aboutdefault: "Un mystère..." + administrativeinfo: "Informations administratives" + email: "E-mail :" + recentvotes: "Votes récents :" + commentlinktext: "comment" + administrativeactions: "Actions administratives" + unbanuser: "Unban User" + banningdescription: "Bannir ou désactiver les invitations pour un utilisateur enverra un e-mail à l'utilisateur avec la raison ci-dessous avec l'adresse e-mail dans le champ Reply-To afin qu'il puisse répondre." + banningreason: "Raison :" + banuserbutton: "Bannir l'utilisateur" + enableinvitesforuser: "Activer les invitations pour l'utilisateur" + disableinvitesreason: "Raison :" + disableinvitesbutton: "Désactiver les invitations" + tree: + newestusers: "Plus récents utilisateurs" + administrator: "(administrateur)" + moderator: "(modérateur)" +# data for users/invitationform which is a partial view + invitationtext: "Le nombre d'invitations est illimité, mais les personnes que vous invitez sont associées à votre compte dans l'arbre des utilisateurs et vous pourriez être tenu pour responsable s'ils causent des problèmes. Merci d'évaluer le fait d'inviter des gens que vous ne connaissez pas personnellement." + emailaddress: "Adresse e-mail :" + memouser: "Message à l'utilisateur :" + sendinvitation: "Envoyer l'invitation" date: abbr_day_names: - dim