translate suggest view and controller. fixes #6

This commit is contained in:
Carl Chenet 2016-11-21 11:59:38 +01:00
parent 948320b676
commit fac9efc706
5 changed files with 22 additions and 9 deletions

View file

@ -173,7 +173,7 @@ class StoriesController < ApplicationController
def suggest
if !@story.can_have_suggestions_from_user?(@user)
flash[:error] = "You are not allowed to offer suggestions on that story."
flash[:error] = I18n.t 'controllers.stories_controller.flashnotallowedsuggestion'
return redirect_to @story.comments_path
end
@ -187,7 +187,7 @@ class StoriesController < ApplicationController
def submit_suggestions
if !@story.can_have_suggestions_from_user?(@user)
flash[:error] = "You are not allowed to offer suggestions on that story."
flash[:error] = I18n.t 'controllers.stories_controller.flashnotallowedsuggestion'
return redirect_to @story.comments_path
end
@ -209,7 +209,7 @@ class StoriesController < ApplicationController
if dsug
ostory = @story.reload
flash[:success] = "Your suggested changes have been noted."
flash[:success] = I18n.t 'controllers.stories_controller.flashallowedsuggestion'
end
redirect_to ostory.comments_path
else

View file

@ -1,6 +1,6 @@
<div class="box" id="story_box">
<div class="legend">
Suggest Story Changes
<%= t :suggeststorychanges %>
</div>
<%= form_for @story, :url => story_suggest_path(@story.short_id),
@ -12,8 +12,8 @@
<div class="box">
<div class="boxline actions">
<%= submit_tag "Suggest Changes" %>
&nbsp;or <a href="<%= story_path(@story.short_id) %>">cancel</a>
<%= submit_tag t :suggestchangesbutton %>
&nbsp;<%= t :suggestor %> <a href="<%= story_path(@story.short_id) %>"><%= t :suggestcancel %></a>
</div>
</div>
<% end %>

View file

@ -21,7 +21,7 @@ module Lobsters
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = :fr
#config.i18n.default_locale = :fr
# Raise an exception when using mass assignment with unpermitted attributes
config.action_controller.action_on_unpermitted_parameters = :raise

View file

@ -263,7 +263,7 @@ en:
authoredby: "authored by"
via: "via"
justnow: "just now"
edit: "éditer"
edit: "edit"
delete: "delete"
confirmundelete: "Are you sure you want to undelete this story?"
undelete: "undelete"
@ -357,4 +357,10 @@ en:
stories_controller:
submitstorytitle: "Submit Story"
editstorytitle: "Edit Story"
flashnotallowedsuggestion: "You are not allowed to offer suggestions on that story."
flashallowedsuggestion: "Your suggested changes have been noted."
# views.stories.suggest scop, unable to get it, I don't know why
suggeststorychanges: "Suggest Story Changes"
suggestchangesbutton: "Suggest Changes"
suggestor: "or"
suggestcancel: "Cancel"

View file

@ -370,6 +370,13 @@ fr:
stories_controller:
submitstorytitle: "Soumettre une info"
editstorytitle: "Éditer une info"
flashnotallowedsuggestion: "Vous n'êtes pas autorisé à offrir des suggestions pour cette info."
flashallowedsuggestion: "Les changements que vous avez suggérés ont été notés."
# suggest.stories scope, unable to get it so global, I don't know why
suggeststorychanges: "Suggérer des changements à l'info"
suggestchangesbutton: "Suggérer des changements"
suggestor: "ou"
suggestcancel: "Annuler"
date:
abbr_day_names:
- dim