i18n of moderation of the comments. closes #12

This commit is contained in:
Carl Chenet 2016-12-06 18:09:55 +01:00
parent 050ce74871
commit b8144e19c0
4 changed files with 10 additions and 6 deletions

View file

@ -241,7 +241,7 @@ var _Lobsters = Class.extend({
},
moderateStory: function(link) {
var reason = prompt("Moderation reason:");
var reason = prompt("Raison de la modération :");
if (reason == null || reason == "")
return false;
@ -410,7 +410,7 @@ $(document).ready(function() {
});
$(document).on("click", "a.comment_moderator", function() {
var reason = prompt("Moderation reason:");
var reason = prompt("Raison de la modération :");
if (reason == null || reason == "")
return false;

View file

@ -198,7 +198,7 @@ class Comment < ActiveRecord::Base
m = Moderation.new
m.comment_id = self.id
m.moderator_user_id = user.id
m.action = "deleted comment"
m.action = I18n.t('models.comment.deletedcomment')
if reason.present?
m.reason = reason
@ -284,9 +284,7 @@ class Comment < ActiveRecord::Base
def gone_text
if self.is_moderated?
"Thread removed by moderator " <<
self.moderation.try(:moderator).try(:username).to_s << ": " <<
(self.moderation.try(:reason) || "No reason given")
I18n.t('models.comment.threadremovedby', :modoname => "#{self.moderation.try(:moderator).try(:username).to_s}", :modreason => "#{(self.moderation.try(:reason) || "No reason given")}")
elsif self.user.is_banned?
"Comment from banned user removed"
else

View file

@ -9,6 +9,9 @@ en:
invitation_mailer:
subject: "[%{appname}] You have been invited to %{appname}"
models:
comment:
deletedcomment: "deleted comment"
threadremovedby: "Thread removed by moderator %{modoname} : %{modreason}"
moderation:
storyeditedby: "Your story has been edited by "
usersuggestions: "user suggestions"

View file

@ -21,6 +21,9 @@ fr:
invitation_mailer:
subject: "[%{appname}] Vous avez été invité au %{appname}"
models:
comment:
deletedcomment: "commentaire supprimé"
threadremovedby: "Fil supprimé par le modérateur %{modoname} : %{modreason}"
moderation:
storyeditedby: "Votre info a été éditée par "
usersuggestions: "suggestions d'utilisateur"