i18n of stories/_form view

This commit is contained in:
Carl Chenet 2016-11-09 15:50:22 +01:00
parent c751792f9f
commit 06c58f136b
3 changed files with 167 additions and 45 deletions

View file

@ -1,23 +1,18 @@
<% if f.object.errors.count == 1 && f.object.already_posted_story %>
<div class="flash-error">
<h2>Error: This story was already submitted <%=
time_ago_in_words_label(f.object.already_posted_story.created_at) %></h2>
<h2><%= t('.alreadysubmitted') %><%=
time_ago_in_words(f.object.already_posted_story.created_at) %></h2>
<p>
Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
target="_blank">previous discussion</a> for this story.
<%= raw(t('.previousdiscussion', :storypath => "#{f.object.already_posted_story.comments_path}")) %>
</p>
</div>
<% elsif f.object.errors.any? %>
<%= error_messages_for f.object %>
<% elsif !f.object.errors.any? && f.object.already_posted_story %>
<div class="flash-notice">
<h2>Note: This story was already submitted <%=
time_ago_in_words_label(f.object.already_posted_story.created_at) %>, but
may be submitted again.</h2>
<h2><%= t('.alreadysubmittedflash', :timeago => "{time_ago_in_words(f.object.already_posted_story.created_at)}") %></h2>
<p>
Please view the <a href="<%= f.object.already_posted_story.comments_path %>"
target="_blank">previous discussion</a> for this story first. If the content
has changed or warrants new discussion, you may submit it again.
<%= raw(t('.previousexpireddiscussion', :storypath => "#{f.object.already_posted_story.comments_path}")) %>
</p>
</div>
@ -28,12 +23,12 @@
<% unless defined?(suggesting) %>
<div class="boxline">
<% if f.object.url_is_editable_by_user?(@user) %>
<%= f.label :url, "URL:", :class => "required" %>
<%= f.label :url, t('.url'), :class => "required" %>
<%= f.text_field :url, :autocomplete => "off" %>
<%= button_tag "Fetch Title", :id => "story_fetch_title",
<%= button_tag t('.fetchtitle'), :id => "story_fetch_title",
:type => "button" %>
<% elsif !f.object.new_record? && !f.object.url.blank? %>
<%= f.label :url, "URL:", :class => "required" %>
<%= f.label :url, t('.url'), :class => "required" %>
<div class="d">
<a href="<%= f.object.url %>"><%= f.object.url %></a>
</div>
@ -42,7 +37,7 @@
<% end %>
<div class="boxline">
<%= f.label :title, "Title:", :class => "required" %>
<%= f.label :title, t('.title'), :class => "required" %>
<%= f.text_field :title, :maxlength => 100, :autocomplete => "off" %>
</div>
@ -55,7 +50,7 @@
<% title_votes.delete(f.object.title) %>
<% if title_votes.any? %>
<div class="boxline actions">
Users have suggested changing this story's title to:
<%= t('.changetitle') %>
<br>
<% title_votes.each do |ti,c| %>
<%= h(ti) %><%= c == 1 ? "" : " (#{c} votes)" %><br>
@ -65,7 +60,7 @@
<% end %>
<div class="boxline" style="margin-bottom: 2px;">
<%= f.label :tags_a, "Tags:", :class => "required",
<%= f.label :tags_a, t('.tags'), :class => "required",
:style => "line-height: 2.3em;" %>
<%= f.select "tags_a", options_for_select(
Tag.all_with_filtered_counts_for(@user).map{|t|
@ -93,7 +88,7 @@
<% tag_votes.delete(f.object.tags_a.sort.join(", ")) %>
<% if tag_votes.any? %>
<div class="boxline actions">
Users have suggested changing this story's tags to:
<%= t('.changetags') %>
<br>
<% tag_votes.each do |ts,c| %>
<%= ts %><%= c == 1 ? "" : " (#{c} votes)" %><br>
@ -104,55 +99,38 @@
<% unless defined?(suggesting) %>
<div class="boxline">
<%= f.label :description, "Text:", :class => "required" %>
<%= f.label :description, t('.text'), :class => "required" %>
<%= f.text_area :description, :rows => 15,
:placeholder => "Optional when submitting a URL; please see guidelines",
:placeholder => t('.placeholdertext'),
:autocomplete => "off" %>
</div>
<div class="boxline actions markdown_help_toggler">
<a href="#" id="story_guidelines_toggler">
Story submission guidelines
<%= t('.storysubmissionguidelines') %>
</a>
<div id="story_guidelines" style="<%= show_guidelines?? "" :
"display: none;" %>">
<ul>
<li><p>
Do not editorialize story titles, but when the original story's
title has no context or is unclear, please change it. <strong>Please
remove extraneous components from titles such as the name of the
site or section.</strong>
<%= raw(t('.guidelinespart1')) %>
</p></li>
<li><p>
When the story being submitted is more than a year or so old,
please add the year the story was written to the post title in
parentheses.
<%= t('.guidelinespart2') %>
</p></li>
<li><p>
When submitting a URL, the text field is optional and should only
be used when additional context or explanation of the URL is
needed. Commentary or opinion should be reserved for a comment,
so that it can be voted on separately from the story.
<%= t('.guidelinespart3') %>
</p></li>
<li><p>
If no tags clearly apply to the story you are submitting, chances
are it does not belong here. Do not overreach with tags if they
are not the primary focus of the story.
<%= raw(t('.guidelinespart4')) %>
</p></li>
<li><p>
To be able to easily submit a page you're viewing in your browser
to <%= Rails.application.name %>, drag this bookmarklet to your
bookmark bar:
[<a href="javascript:{window.open(%22<%= Rails.application.root_url
%>stories/new?url=%22+encodeURIComponent(document.location)+<%
%>%22&title=%22+encodeURIComponent(document.title));%20void(0);}<%
%>">Submit to <%= Rails.application.name %></a>].
You'll be taken to this page with the viewed page's URL and title.
<%= raw(t('.guidelinespart5', :rooturl => "#{Rails.application.root_url}", :appname => "#{Rails.application.name}")) %>
</p></li>
</ul>
@ -163,11 +141,11 @@
<% unless defined?(suggesting) %>
<div class="box">
<div class="boxline">
<%= f.label :user_is_author, "Author:", :class => "required" %>
<%= f.label :user_is_author, t('.author'), :class => "required" %>
<%= f.check_box :user_is_author %>
<%= f.label :user_is_author,
(f.object.id && f.object.user_id != @user.id ? "Submitter is" : "I am") +
" the author of the story at this URL (or this text)",
(f.object.id && f.object.user_id != @user.id ? t('.submitter') : t('.iamauthor')) +
t('.authorownership'),
:class => "normal" %>
</div>
</div>

View file

@ -138,6 +138,29 @@ en:
memouser: "Memo to User:"
sendinvitation: "Send Invitation"
stories:
form:
alreadysubmitted: "Error: This story was already submitted "
alreadysubmittedflash: "Note: This story was already submitted %{timeago} but may be submitted again."
previousdiscussion: "Please view the <a href=\"%{storypath}\" target=\"_blank\">previous discussion</a> for this story."
previousexpireddiscution: "Please view the <a href=\"%{storypath}\" \"target=_blank\">previous discussion</a> for this story first. If the content has changed or warrants new discussion, you may submit it again."
fetchtitle: "Fetch Title"
url: "URL:"
title: "Title:"
changetitle: "Users have suggested changing this story's title to:"
tags: "Tags:"
changetags: "Users have suggested changing this story's tags to:"
text: "Text:"
placeholdertext: Optional when submitting a URL; please see guidelines"
storysubmissionguidelines: "Story submission guidelines"
guidelinespart1: "Do not editorialize story titles, but when the original story's title has no context or is unclear, please change it. <strong>Please remove extraneous components from titles such as the name of the site or section.</strong>"
guidelinespart2: "When the story being submitted is more than a year or so old, please add the year the story was written to the post title in parentheses."
guidelinespart3: "When submitting a URL, the text field is optional and should only be used when additional context or explanation of the URL is needed. Commentary or opinion should be reserved for a comment, so that it can be voted on separately from the story."
guidelinespart4: "If no tags clearly apply to the story you are submitting, chances are it does not belong here. Do not overreach with tags if they are not the primary focus of the story."
guidelinespart5: "To be able to easily submit a page you're viewing in your browser to Journal du hacker, drag this bookmarklet to your bookmark bar: [<a href=\"javascript:{window.open(%22%{rooturl}stories/new?url=%22+encodeURIComponent(document.location)+%22&title=%22+encodeURIComponent(document.title));%20void(0);}\">Submit to %{appname}</a>]. You'll be taken to this page with the viewed page's URL and title."
submitter: "Submitter is"
author: "Author:"
iamauthor: "I am"
authorownership: " the author of the story at this URL (or this text)"
new:
markdown: "Markdown formatting available"
preview: "Preview"

View file

@ -150,8 +150,129 @@ fr:
memouser: "Message à l'utilisateur :"
sendinvitation: "Envoyer l'invitation"
stories:
form:
alreadysubmitted: "Erreur : Cette info a déjà été proposée "
alreadysubmittedflash: "Note: Cette info a déjà été proposée %{timeago} mais peut être de nouveau reproposée."
previousdiscussion: "Merci de consulter <a href=\"%{storypath}\" target=\"_blank\"> la discussion précédente</a> pour cette info."
previousexpireddiscution: "Merci de consulter <a href=\"%{storypath}\" \"target=_blank\">la discussion précédente</a> pour la première proposition de cette info. Si le contenu a changé ou génère de nouvelles discussions, vous pouvez la proposer de nouveau."
fetchtitle: "Prendre le titre"
url: "URL :"
title: "Titre :"
changetitle: "Les utilisateurs ont proposé de changer le titre de l'info par :"
tags: "Marque :"
changetags: "Les utilisateurs ont proposé de changer les marques de l'info par :"
text: "Texte :"
placeholdertext: "Optionnel quand vous proposez une URL; se référer au mode d'emploi"
storysubmissionguidelines: "Lignes directrices de la proposition d'une info"
guidelinespart1: "Ne pas éditer les titres des infos, mais quand le titre original n'a pas de contexte ou est peu clair, changez-le. <strong>Merci de supprimer du titre le nom du site ou la section.</strong>"
guidelinespart2: "Quand l'info proposée a plus d'un an, merci d'ajouter en fin de titre entre parenthèse la date de publication."
guidelinespart3: "Quand une URL est proposée, le champ texte est optionnel et doit être utilisé seulement si du contexte ou des explications sur l'info proposée est nécessaire. Un commentaire ou une opinion doit faire l'objet d'un commentaire, afin qu'il reçoive un vote autre que celui de l'info. "
guidelinespart4: "Si aucune marque ne s'applique à l'info, il y a de fortes chances qu'elle ne corresponde pas aux <a href=\"/about\" \"target=_blank\">sujets couverts</a>. Ne pas entrer une marque ne s'appliquant pas à l'info."
guidelinespart5: "Pour proposer facilement une page que vous visionnez dans votre navigateur au %{appname}, cliquez-glissez ce bookmarklet vers votre barre de navigation: [<a href=\"javascript:{window.open(%22%{rooturl}stories/new?url=%22+encodeURIComponent(document.location)+%22&title=%22+encodeURIComponent(document.title));%20void(0);}\">Soumettre au %{appname}</a>]. Vous serez redirigé vers la page actuelle avec l'URL et le titre de la page d'info."
submitter: "L'auteur est"
author: "Auteur :"
iamauthor: "Je suis"
authorownership: " l'auteur de l'info à cette URL (ou de ce texte)"
new:
markdown: "Utilisation du Markdown possible"
preview: "Aperçu"
submit: "Soumettre une info"
submitbutton: "Soumettre"
date:
abbr_day_names:
- dim
- lun
- mar
- mer
- jeu
- ven
- sam
abbr_month_names:
-
- jan.
- fév.
- mar.
- avr.
- mai
- juin
- juil.
- août
- sept.
- oct.
- nov.
- déc.
day_names:
- dimanche
- lundi
- mardi
- mercredi
- jeudi
- vendredi
- samedi
formats:
default: "%d/%m/%Y"
short: "%e %b"
long: "%e %B %Y"
month_names:
-
- janvier
- février
- mars
- avril
- mai
- juin
- juillet
- août
- septembre
- octobre
- novembre
- décembre
order:
- :day
- :month
- :year
datetime:
distance_in_words:
about_x_hours:
one: environ une heure
other: environ %{count} heures
about_x_months:
one: environ un mois
other: environ %{count} mois
about_x_years:
one: environ un an
other: environ %{count} ans
almost_x_years:
one: presqu'un an
other: presque %{count} ans
half_a_minute: une demi-minute
less_than_x_minutes:
zero: moins d'une minute
one: moins d'une minute
other: moins de %{count} minutes
less_than_x_seconds:
zero: moins d'une seconde
one: moins d'une seconde
other: moins de %{count} secondes
over_x_years:
one: plus d'un an
other: plus de %{count} ans
x_days:
one: 1 jour
other: "%{count} jours"
x_minutes:
one: 1 minute
other: "%{count} minutes"
x_months:
one: 1 mois
other: "%{count} mois"
x_seconds:
one: 1 seconde
other: "%{count} secondes"
prompts:
day: Jour
hour: Heure
minute: Minute
month: Mois
second: Seconde
year: Année