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'

View file

@ -23,17 +23,15 @@ de:
new:
title: Nachrichtengruppe anlegen
show:
confirm: Bist Du sicher?
edit: Gruppe/Mitglieder bearbeiten
send_message: Nachricht senden
title: Nachrichtengruppe %{name}
messagegroups:
members: Mitglieder
name: Name
home:
index:
message_threads:
view_all: Alle Nachrichteverläufe anzeigen
messages:
view_all:
text: '%{messages} oder %{threads} anzeigen'
messages:
threads:
messagegroups:
index:
body: Du kannst jede der Nachrichtengruppen beitreten oder sie wieder verlassen.
@ -52,10 +50,7 @@ de:
message_threads:
messagegroups:
messages:
create:
notice: Message is saved and will be sent.
index:
message_threads: Nachrichtenverläufe
new: Neue Nachricht
thread:
all_message_threads: Alle Nachrichtenverläufe
reply: Antworten
@ -63,7 +58,6 @@ de:
groupmessage_threads:
show_message_threads: Alle Nachrichtenverläufe anzeigen
index:
new: Neue Nachricht
other: Allgemeine Nachrichten
title: Nachrichtenverläufe
message_threads:
@ -73,7 +67,6 @@ de:
started_by: Gestartet von
show:
other: Allgemeine Nachrichten
reply: Antworten
navigation:
admin:
messagegroups: Nachrichtengruppen

View file

@ -31,13 +31,8 @@ en:
new:
title: Create message group
show:
confirm: Are you sure?
edit: Edit group/members
send_message: Send message
title: Message group %{name}
messagegroups:
members: Members
name: Name
ordergroups:
show:
send_message: Send message
@ -63,7 +58,10 @@ en:
index:
messages:
title: Newest messages
view_all: See all messages
view_all:
text: 'Show %{messages} or %{threads}'
messages: all messages
threads: threads
start_nav:
write_message: Write message
messagegroups:
@ -84,10 +82,10 @@ en:
message_threads: Show as threads
messagegroups: Subscribe to groups
messages: Show as list
new: New message
create:
notice: Message is saved and will be sent.
index:
new: New message
title: Messages
messages:
reply: Reply
@ -96,6 +94,7 @@ en:
reply_indent: ! '> %{line}'
reply_subject: ! 'Re: %{subject}'
new:
error_private: Sorry, this message is private.
hint_private: Message doesnt show in Foodsoft mail inbox
list:
desc: ! 'Please send messages to all using the mailing-list: %{list}'
@ -125,13 +124,15 @@ en:
groupmessage_threads:
show_message_threads: show all
index:
new: New message
other: General
title: Message threads
message_threads:
last_reply_at: Last replied at
last_reply_by: Last replied by
started_at: Started at
started_by: Started by
show:
all_message_threads: All message threads
other: General
reply: Reply
messages_mailer:
foodsoft_message:
footer: ! 'Reply: %{reply_url}