i18n of stories/listdetail view

This commit is contained in:
Carl Chenet 2016-11-10 11:16:52 +01:00
parent 588ab40e7d
commit ef03140149
3 changed files with 84 additions and 43 deletions

View file

@ -22,8 +22,7 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
break_long_words(story.title) %></a>
<% end %>
<% if story.is_gone? %>
[Story removed by <%= story.is_moderated? ? "moderator" :
"original submitter" %>]
<%= t('.storyremovedby', :user => story.is_moderated? ? t('.moderator') : t('.originalsubmitter')) %>
<% end %>
</span>
<% if story.markeddown_description.present? %>
@ -70,14 +69,14 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<%= ms.user.avatar_url(32) %> 2x" class="avatar"></a>
<% end %>
<% if story.user_is_author? %>
authored by
<%= t('.authoredby') %>
<% else %>
via
<%= t('.via') %>
<% end %>
<a href="/u/<%= ms.user.username %>" class="<%=
ms.html_class_for_user %>"><%= ms.user.username %></a>
<%= time_ago_in_words_label(ms.created_at, :strip_about => true) %>
<%= distance_of_time_in_words(ms.created_at, Time.now, :strip_about => true) %>
</span>
<% end %>
<% end %>
@ -101,62 +100,62 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<% end %>
<% if story.previewing %>
<% if story.user_is_author? %>
authored by
<%= t('.authoredby') %>
<% else %>
via
<%= t('.via') %>
<% end %>
<a class="<%= story.html_class_for_user %>"><%=
story.user.username %></a>
just now
<%= t('.justnow') %>
<% else %>
<% if story.user_is_author? %>
authored by
<%= t('.authoredby') %>
<% else %>
via
<%= t('.via') %>
<% end %>
<a href="/u/<%= story.user.username %>" class="<%=
story.html_class_for_user %>"><%= story.user.username %></a>
<%= time_ago_in_words_label(story.created_at, :strip_about => true) %>
<%= distance_of_time_in_words(story.created_at, Time.now, :strip_about => true) %>
<% if story.is_editable_by_user?(@user) %>
|
<a href="<%= edit_story_path(story.short_id) %>">edit</a>
<a href="<%= edit_story_path(story.short_id) %>"><%= t('.edit') %></a>
<% if story.is_gone? && story.is_undeletable_by_user?(@user) %>
|
<%= link_to "undelete", story_undelete_path(story.short_id),
<%= link_to t('.undelete'), story_undelete_path(story.short_id),
:method => :post, :data => {
:confirm => "Are you sure you want to undelete this story?" } %>
:confirm => t('.confirmundelete') } %>
<% elsif !story.is_gone? %>
|
<% if story.user_id != @user.try(:id) &&
@user.try(:is_moderator?) %>
<%= link_to "delete", story_path(story.short_id),
<%= link_to t('.delete'), story_path(story.short_id),
:method => :delete, :class => "mod_story_link" %>
<% else %>
<%= link_to "delete", story_path(story.short_id),
<%= link_to t('.delete'), story_path(story.short_id),
:method => :delete, :data => {
:confirm => "Are you sure you want to delete this story?" } %>
:confirm => t('.confirmdelete') } %>
<% end %>
<% end %>
<% end %>
<% if story.can_have_suggestions_from_user?(@user) %>
| <%= link_to "suggest", story_suggest_path(story.short_id),
| <%= link_to t('.suggest'), story_suggest_path(story.short_id),
:class => "suggester" %>
<% end %>
<% if !story.is_gone? && @user %>
<% if @user && story.vote && story.vote[:vote] == -1 %>
| <a class="flagger">unflag (<%=
| <a class="flagger"><%= t('.unflag') %> (<%=
Vote::STORY_REASONS[story.vote[:reason]].to_s.downcase %>)</a>
<% elsif @user && @user.can_downvote?(story) %>
| <a class="flagger">flag</a>
| <a class="flagger"><%= t('.flag') %></a>
<% end %>
<% if story.is_hidden_by_cur_user %>
| <%= link_to "unhide", story_unhide_path(story.short_id),
| <%= link_to t('.unhide'), story_unhide_path(story.short_id),
:class => "hider" %>
<% else %>
| <%= link_to "hide", story_hide_path(story.short_id),
| <%= link_to t('.hide'), story_hide_path(story.short_id),
:class => "hider" %>
<% end %>
<% if defined?(single_story) && single_story && story.hider_count > 0 %>
@ -166,17 +165,17 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<% if story.url.present? %>
|
<a href="https://archive.is/<%= story.url %>" rel="nofollow"
target="_new">cached</a>
target="_new"><%= t('.cached') %></a>
<% end %>
<% if !story.is_gone? %>
<span class="comments_label">
|
<a href="<%= story.comments_path %>">
<% if story.comments_count == 0 %>
no comments
<%= t('.nocomment') %>
<% else %>
<%= story.comments_count %>
comment<%= story.comments_count == 1 ? "" : "s" %>
<%= story.comments_count == 1 ? t('.commentsingular') : t('.commentplurial') %>
<% end %>
</a>
</span>

View file

@ -180,6 +180,27 @@ en:
author: "Author:"
iamauthor: "I am"
authorownership: " the author of the story at this URL (or this text)"
listdetail:
storyremovedby: "[Story removed by %{user}]"
moderator: "the moderator"
originalsubmitter: "the original submitter"
authoredby: "authored by"
via: "via"
justnow: "just now"
edit: "éditer"
delete: "delete"
confirmundelete: "Are you sure you want to undelete this story?"
undelete: "undelete"
confirmdelete: "Are you sure you want to delete this story?"
suggest: "suggest"
unflage: "unflag"
flag: "flag"
hide: "hide"
unhide: "unhide"
cached: "cached"
nocomment: "no comment"
commentsingular: "comment"
commentplurial: "comments"
new:
markdown: "Markdown formatting available"
preview: "Preview"

View file

@ -192,6 +192,27 @@ fr:
author: "Auteur :"
iamauthor: "Je suis"
authorownership: " l'auteur de l'info à cette URL (ou de ce texte)"
listdetail:
storyremovedby: "[Info supprimée par %{user}]"
moderator: "le modérateur"
originalsubmitter: "le contributeur d'origine"
authoredby: "écrit par"
via: "via"
justnow: "à l'instant"
edit: "éditer"
delete: "supprimer"
confirmundelete: "Êtes-vous sûr de vouloir désupprimer cette info ?"
undelete: "désupprimer"
confirmdelete: "Êtes-vous sûr de vouloir supprimer cette info ?"
suggest: "suggérer"
unflag: "désindiquer"
flag: "indiquer"
hide: "cacher"
unhide: "décacher"
cached: "en cache"
nocomment: "pas de commentaire"
commentsingular: "commentaire"
commentplurial: "commentaires"
new:
markdown: "Utilisation du Markdown possible"
preview: "Aperçu"
@ -253,20 +274,20 @@ fr:
datetime:
distance_in_words:
about_x_seconds:
one: environ une seconde
other: environ %{count} seconds
one: il y a une seconde
other: il y a %{count} seconds
about_x_minutes:
one: environ une minute
other: environ %{count} minutes
one: il y a une minute
other: il y a %{count} minutes
about_x_hours:
one: environ une heure
other: environ %{count} heures
one: il y a une heure
other: il y a %{count} heures
about_x_months:
one: environ un mois
other: environ %{count} mois
one: il y a un mois
other: il y a %{count} mois
about_x_years:
one: environ un an
other: environ %{count} ans
one: il y a un an
other: il y a %{count} ans
almost_x_years:
one: presqu'un an
other: presque %{count} ans
@ -283,17 +304,17 @@ fr:
one: plus d'un an
other: plus de %{count} ans
x_days:
one: 1 jour
other: "%{count} jours"
one: il y a 1 jour
other: "il y a %{count} jours"
x_minutes:
one: 1 minute
other: "%{count} minutes"
one: il y a 1 minute
other: "il y a %{count} minutes"
x_months:
one: 1 mois
other: "%{count} mois"
one: il y a 1 mois
other: "il y a %{count} mois"
x_seconds:
one: 1 seconde
other: "%{count} secondes"
one: il y a 1 seconde
other: "il y a %{count} secondes"
prompts:
day: Jour
hour: Heure