Correct messages i18n

This commit is contained in:
wvengen 2016-03-07 22:17:18 +01:00
parent 5d9e1845b7
commit 80ab359860
8 changed files with 25 additions and 34 deletions

View file

@ -24,7 +24,7 @@ class MessagesController < ApplicationController
@message.body = I18n.t('messages.model.reply_header', :user => original_message.sender.display, :when => I18n.l(original_message.created_at, :format => :short)) + "\n"
original_message.body.each_line{ |l| @message.body += I18n.t('messages.model.reply_indent', :line => l) }
else
redirect_to new_message_url, alert: 'Nachricht ist privat!'
redirect_to new_message_url, alert: I18n.t('messages.new.error_private')
end
end
end

View file

@ -7,14 +7,14 @@ class MessagesMailer < Mailer
reply_email_domain = FoodsoftConfig[:reply_email_domain]
if reply_email_domain
hash = message.mail_hash_for_user recipient
reply_to = "Foodsoft <#{FoodsoftConfig.scope}.#{message.id}.#{recipient.id}.#{hash}@#{reply_email_domain}>"
reply_to = "#{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig.scope}.#{message.id}.#{recipient.id}.#{hash}@#{reply_email_domain}>"
else
reply_to = "#{show_user(message.sender)} <#{message.sender.email}>"
end
mail subject: "[#{FoodsoftConfig[:name]}] " + message.subject,
to: recipient.email,
from: "#{show_user(message.sender)} via Foodsoft <#{FoodsoftConfig[:email_sender]}>",
from: "#{show_user(message.sender)} via #{I18n.t('layouts.foodsoft')} <#{FoodsoftConfig[:email_sender]}>",
reply_to: reply_to
end
end

View file

@ -4,7 +4,4 @@
%section#messages
%h2= t '.messages.title'
= render 'messages/messages', messages: Message.pub.order('created_at DESC').limit(5), pagination: false
%p
= link_to t('.messages.view_all'), messages_path
!= ' | '
= link_to t('.message_threads.view_all'), message_threads_path
%p= raw t '.messages.view_all.text', messages: link_to(t('.messages.view_all.messages'), messages_path), threads: link_to(t('.messages.view_all.threads'), message_threads_path)

View file

@ -5,5 +5,5 @@
- if Messagegroup.any?
.controls
= link_to messagegroups_path do
= t('shared.user_form_fields.messagegroups')
= t '.messagegroups'
%i.icon.icon-chevron-right

View file

@ -4,8 +4,8 @@
%table.table.table-striped
%thead
%tr
%th= t '.name'
%th= t '.members'
%th= Messagegroup.human_attribute_name :name
%th= Messagegroup.human_attribute_name :user_tokens
%th= t 'ui.actions'
%tbody
- for messagegroup in @messagegroups

View file

@ -2,5 +2,5 @@
%section= render 'shared/group', group: @messagegroup
= link_to t('ui.edit'), edit_admin_messagegroup_path(@messagegroup), class: 'btn'
= link_to t('ui.delete'), [:admin, @messagegroup], :data => {:confirm => t('.confirm')}, :method => :delete, class: 'btn btn-danger'
= link_to t('ui.delete'), [:admin, @messagegroup], :data => {:confirm => t('ui.confirm_delete', name: @messagegroup.name)}, :method => :delete, class: 'btn btn-danger'
= link_to t('.send_message'), new_message_path(:message => {:group_id => @messagegroup.id}), class: 'btn'