From 588ab40e7d06498eb0303cca54e099d8fc4930bf Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Wed, 9 Nov 2016 17:25:40 +0100 Subject: [PATCH] i18n of comment/_comment view --- app/views/comments/_comment.html.erb | 25 ++++++++++++------------- config/locales/en.yml | 10 ++++++++++ config/locales/fr.yml | 16 ++++++++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 22476d9..8f9ab4c 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -48,46 +48,45 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ? <% end %> <% if comment.previewing %> - previewed - just now + <%= t('.previewed') %> <% else %> <% if comment.has_been_edited? %> - edited + <%= t('.edited') %> <% elsif comment.is_from_email? %> - e-mailed + <%= t('.emailed') %> <% end %> - <%= time_ago_in_words_label((comment.has_been_edited? ? - comment.updated_at : comment.created_at), :strip_about => true) %> + <%= distance_of_time_in_words((comment.has_been_edited? ? + comment.updated_at : comment.created_at), Time.now, :strip_about => true) %> <% end %> <% if !comment.previewing %> | - link + <%= t('.link') %> <% if comment.is_editable_by_user?(@user) %> | - edit + <%= t('.edit') %> <% end %> <% if comment.is_gone? && comment.is_undeletable_by_user?(@user) %> | - undelete + <%= t('.undelete') %> <% elsif !comment.is_gone? && comment.is_deletable_by_user?(@user) %> | <% if @user && @user.is_moderator? && @user.id != comment.user_id %> - delete + <%= t('.delete') %> <% else %> - delete + <%= t('.delete') %> <% end %> <% end %> <% if @user && !comment.story.is_gone? && !comment.is_gone? %> | - reply + <%= t('.reply') %> <% end %> <% if defined?(show_story) && show_story %> - | on: + | <%= t('.on') %> <%= comment.story.title %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 191adea..f080cf3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -56,6 +56,16 @@ en: preview: "Preview" cancel: "Cancel" putonhat: "Put on hat:" + comment: + previewed: "previewed just now" + edited: "edited" + emailed: "e-mailed" + link: "link" + edit: "edit" + undelete: "undelete" + delete: "delete" + reply: "reply" + on: "on:" home: index: homerecentsdesc: "The newest stories with a random sampling of recently submitted stories that have not yet reached the front page." diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c4a4fa9..6bf74aa 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -58,6 +58,16 @@ fr: preview: "Aperçu" cancel: "Annuler" putonhat: "Mettre son chapeau : " + comment: + previewed: "prévisualisé à l'instant" + edited: "édité" + emailed: "envoyé par e-mail" + link: "lien" + edit: "éditer" + undelete: "désupprimer" + delete: "supprimer" + reply: "répondre" + on: "sur :" home: index: homerecentsdesc: "Les plus récentes infos avec un panaché aléatoire des infos récentes soumises qui n'ont pas encore atteint la page principale." @@ -242,6 +252,12 @@ fr: - :year datetime: distance_in_words: + about_x_seconds: + one: environ une seconde + other: environ %{count} seconds + about_x_minutes: + one: environ une minute + other: environ %{count} minutes about_x_hours: one: environ une heure other: environ %{count} heures