i18n simple_form move of foodcoop

This commit is contained in:
wvengen 2013-10-09 23:00:07 +02:00
parent 552af7925d
commit 78c81b194c
4 changed files with 28 additions and 28 deletions

View file

@ -79,10 +79,12 @@ module ApplicationHelper
# When there is a non-empty model attribute 'foo', it looks for # When there is a non-empty model attribute 'foo', it looks for
# the model attribute translation 'foo_short' and use that as # the model attribute translation 'foo_short' and use that as
# heading, with an acronym title of 'foo'. # heading, with an acronym title of 'foo'.
# Other options are passed through to I18n.
def heading_helper(model, attribute, options = {}) def heading_helper(model, attribute, options = {})
s = model.human_attribute_name(attribute) i18nopts = options.select {|a| !['short'].include?(a) }
s = model.human_attribute_name(attribute, i18nopts)
if options[:short] if options[:short]
sshort = model.human_attribute_name("#{attribute}_short".to_sym, default: '') sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''}))
s = raw "<acronym title='#{s}'>#{sshort}</acronym>" unless sshort.empty? s = raw "<acronym title='#{s}'>#{sshort}</acronym>" unless sshort.empty?
end end
s s

View file

@ -4,12 +4,12 @@
%table.table.table-striped %table.table.table-striped
%thead %thead
%tr %tr
%th= t 'simple_form.labels.user.nick' %th= heading_helper User, :nick
%th= t 'simple_form.labels.user.name' %th= heading_helper User, :name
%th= t 'simple_form.labels.user.email' %th= heading_helper User, :email
%th= t 'simple_form.labels.user.phone' %th= heading_helper User, :phone
%th= t 'simple_form.labels.user.ordergroup' %th= heading_helper User, :ordergroup
%th= t 'simple_form.labels.user.workgroup', count: 3 %th= heading_helper User, :workgroup, count: 3
%tbody %tbody
- for user in @users - for user in @users
%tr %tr

View file

@ -52,8 +52,17 @@ de:
stock_article: stock_article:
price: Nettopreis price: Nettopreis
user: user:
email: Email
first_name: Vorname first_name: Vorname
last_name: Nachname
name: Name
nick: Benutzername
ordergroup: Bestellgruppe
password: Passwort password: Passwort
phone: Telefon
workgroup:
one: Arbeitsgruppe
other: Arbeitsgruppen
errors: errors:
format: ! '%{attribute} %{message}' format: ! '%{attribute} %{message}'
general: Ein Problem ist aufgetreten. general: Ein Problem ist aufgetreten.
@ -1668,16 +1677,6 @@ de:
required_users: Anzahl required_users: Anzahl
user_list: Verantwortliche user_list: Verantwortliche
workgroup: Arbeitsgruppe workgroup: Arbeitsgruppe
user:
email: Email
last_name: Nachname
name: Name
nick: Benutzername
ordergroup: Bestellgruppe
phone: Telefon
workgroup:
one: Arbeitsgruppe
other: Arbeitsgruppen
workgroup: workgroup:
next_weekly_tasks_number: Für wieviel Wochen im Voraus sollen Aufgaben erstellt werden? next_weekly_tasks_number: Für wieviel Wochen im Voraus sollen Aufgaben erstellt werden?
role_admin: Administration role_admin: Administration

View file

@ -71,8 +71,17 @@ en:
user_list: Responsible user user_list: Responsible user
workgroup: Workgroup workgroup: Workgroup
user: user:
email: Email
first_name: First name first_name: First name
last_name: Last name
name: Name
nick: Username
ordergroup: Ordergroup
password: Password password: Password
phone: Telephone
workgroup:
one: Workgroup
other: Workgroups
errors: errors:
format: ! '%{attribute} %{message}' format: ! '%{attribute} %{message}'
general: A problem has occured. general: A problem has occured.
@ -1671,16 +1680,6 @@ en:
phone: Phone phone: Phone
phone2: Phone 2 phone2: Phone 2
url: Homepage url: Homepage
user:
email: Email
last_name: Last name
name: Name
nick: Username
ordergroup: Ordergroup
phone: Telephone
workgroup:
one: Workgroup
other: Workgroups
workgroup: workgroup:
next_weekly_tasks_number: For how many weeks in advance would you like to define tasks? next_weekly_tasks_number: For how many weeks in advance would you like to define tasks?
role_admin: Administration role_admin: Administration