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
# the model attribute translation 'foo_short' and use that as
# heading, with an acronym title of 'foo'.
# Other options are passed through to I18n.
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]
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?
end
s

View File

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

View File

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

View File

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