From 06c58f136bdd41b9b44e728a68a29001685dd200 Mon Sep 17 00:00:00 2001 From: Carl Chenet Date: Wed, 9 Nov 2016 15:50:22 +0100 Subject: [PATCH] i18n of stories/_form view --- app/views/stories/_form.html.erb | 68 ++++++----------- config/locales/en.yml | 23 ++++++ config/locales/fr.yml | 121 +++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+), 45 deletions(-) diff --git a/app/views/stories/_form.html.erb b/app/views/stories/_form.html.erb index 0f91f07..82e32f2 100644 --- a/app/views/stories/_form.html.erb +++ b/app/views/stories/_form.html.erb @@ -1,23 +1,18 @@ <% if f.object.errors.count == 1 && f.object.already_posted_story %>
-

Error: This story was already submitted <%= - time_ago_in_words_label(f.object.already_posted_story.created_at) %>

+

<%= t('.alreadysubmitted') %><%= + time_ago_in_words(f.object.already_posted_story.created_at) %>

- Please view the previous discussion for this story. + <%= raw(t('.previousdiscussion', :storypath => "#{f.object.already_posted_story.comments_path}")) %>

<% elsif f.object.errors.any? %> <%= error_messages_for f.object %> <% elsif !f.object.errors.any? && f.object.already_posted_story %>
-

Note: This story was already submitted <%= - time_ago_in_words_label(f.object.already_posted_story.created_at) %>, but - may be submitted again.

+

<%= t('.alreadysubmittedflash', :timeago => "{time_ago_in_words(f.object.already_posted_story.created_at)}") %>

- Please view the previous discussion 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}")) %>

@@ -28,12 +23,12 @@ <% unless defined?(suggesting) %>
<% 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" %> @@ -42,7 +37,7 @@ <% end %>
- <%= f.label :title, "Title:", :class => "required" %> + <%= f.label :title, t('.title'), :class => "required" %> <%= f.text_field :title, :maxlength => 100, :autocomplete => "off" %>
@@ -55,7 +50,7 @@ <% title_votes.delete(f.object.title) %> <% if title_votes.any? %>
- Users have suggested changing this story's title to: + <%= t('.changetitle') %>
<% title_votes.each do |ti,c| %> <%= h(ti) %><%= c == 1 ? "" : " (#{c} votes)" %>
@@ -65,7 +60,7 @@ <% end %>
- <%= 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? %>
- Users have suggested changing this story's tags to: + <%= t('.changetags') %>
<% tag_votes.each do |ts,c| %> <%= ts %><%= c == 1 ? "" : " (#{c} votes)" %>
@@ -104,55 +99,38 @@ <% unless defined?(suggesting) %>
- <%= 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" %>
- Story submission guidelines + <%= t('.storysubmissionguidelines') %>
">
  • - Do not editorialize story titles, but when the original story's - title has no context or is unclear, please change it. Please - remove extraneous components from titles such as the name of the - site or section. + <%= raw(t('.guidelinespart1')) %>

  • - 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') %>

  • - 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') %>

  • - 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')) %>

  • - 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: - [Submit to <%= Rails.application.name %>]. - 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}")) %>

@@ -163,11 +141,11 @@ <% unless defined?(suggesting) %>
- <%= 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" %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2773806..e9a2c96 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 previous discussion for this story." + previousexpireddiscution: "Please view the previous discussion 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. Please remove extraneous components from titles such as the name of the site or section." + 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: [Submit to %{appname}]. 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" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 1ab639d..20ded3d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -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 la discussion précédente pour cette info." + previousexpireddiscution: "Merci de consulter la discussion précédente 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. Merci de supprimer du titre le nom du site ou la section." + 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 sujets couverts. 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: [Soumettre au %{appname}]. 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