From 64b3d7e17db1680264ec149f6e9931eb0c5bb54c Mon Sep 17 00:00:00 2001 From: Manuel Wiedenmann Date: Mon, 4 Feb 2013 01:38:18 +0700 Subject: [PATCH] finished admin/users i18n + dry the admin i18n --- app/views/admin/ordergroups/_form.html.haml | 2 +- .../admin/ordergroups/_ordergroups.html.haml | 6 +-- app/views/admin/ordergroups/index.html.haml | 2 +- app/views/admin/users/_form.html.haml | 4 +- app/views/admin/users/_users.html.haml | 16 +++--- app/views/admin/users/edit.html.haml | 2 +- app/views/admin/users/index.html.haml | 10 ++-- app/views/admin/users/new.html.haml | 2 +- app/views/admin/users/show.html.haml | 26 +++++----- app/views/admin/workgroups/_form.html.haml | 4 +- .../admin/workgroups/_workgroups.html.haml | 8 +-- app/views/admin/workgroups/index.html.haml | 2 +- config/locales/de/de.admin.yml | 50 ++++++++++++++----- 13 files changed, 78 insertions(+), 56 deletions(-) diff --git a/app/views/admin/ordergroups/_form.html.haml b/app/views/admin/ordergroups/_form.html.haml index b292c728..a7037d72 100644 --- a/app/views/admin/ordergroups/_form.html.haml +++ b/app/views/admin/ordergroups/_form.html.haml @@ -8,4 +8,4 @@ = f.input :ignore_apple_restriction .form-actions = f.button :submit - = link_to t('.or_cancel'), :back + = link_to t('admin.or_cancel'), :back diff --git a/app/views/admin/ordergroups/_ordergroups.html.haml b/app/views/admin/ordergroups/_ordergroups.html.haml index bcc23329..82b72ab4 100644 --- a/app/views/admin/ordergroups/_ordergroups.html.haml +++ b/app/views/admin/ordergroups/_ordergroups.html.haml @@ -8,7 +8,7 @@ %th= t '.contact' %th= t '.address' %th= t '.members' - %th= t '.actions' + %th= t 'admin.actions' %tbody - for ordergroup in @ordergroups %tr{:class => cycle('even','odd', :name => 'groups')} @@ -17,6 +17,6 @@ %td= link_to_gmaps ordergroup.contact_address %td= ordergroup.users.size %td - = link_to t('.edit'), edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini' - = link_to t('.delete'), [:admin, ordergroup], :confirm => t('.confirm', name: ordergroup.name), + = link_to t('admin.edit'), edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini' + = link_to t('admin.delete'), [:admin, ordergroup], :confirm => t('admin.confirm', name: ordergroup.name), :method => :delete, class: 'btn btn-mini btn-danger' \ No newline at end of file diff --git a/app/views/admin/ordergroups/index.html.haml b/app/views/admin/ordergroups/index.html.haml index 11ca7cc3..f3c2133d 100644 --- a/app/views/admin/ordergroups/index.html.haml +++ b/app/views/admin/ordergroups/index.html.haml @@ -10,6 +10,6 @@ = form_tag admin_ordergroups_path, :method => :get, :remote => true, 'data-submit-onchange' => true, class: 'form-search' do = text_field_tag :query, params[:query], class: 'input-medium search-query', - placeholder: t('.search_placeholder') + placeholder: t('admin.search_placeholder') #ordergroups = render "ordergroups" \ No newline at end of file diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 1b8ed55c..c9c28f43 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -1,5 +1,5 @@ = simple_form_for([:admin, @user]) do |f| - = render :partial => 'shared/user_form_fields', :locals => {:f => f} + = render 'shared/user_form_fields', f: f .form-actions = f.submit - = link_to 'oder abbrechen', :back + = link_to t('admin.or_cancel'), :back diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index 6e3a63c1..578423ac 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -4,12 +4,12 @@ %table.table.table-striped %thead %tr - %th Login - %th Name - %th Email - %th Zugriff auf - %th Letzter login - %th(colspan="2") Aktionen + %th= t '.login' + %th= t '.name' + %th= t '.email' + %th= t 'admin.access_to' + %th= t '.last_login' + %th(colspan="2")= t 'admin.actions' %tbody - for user in @users %tr @@ -18,6 +18,6 @@ %td= user.email %td= format_roles(user) %td= format_time(user.last_login) - %td= link_to 'Bearbeiten', edit_admin_user_path(user), class: 'btn btn-mini' - %td= link_to 'Löschen', [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?", + %td= link_to t('admin.edit'), edit_admin_user_path(user), class: 'btn btn-mini' + %td= link_to t('admin.delete'), [:admin, user], :confirm => t('admin.confirm', name: user.name), :method => :delete, class: 'btn btn-danger btn-mini' diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml index 1a16569a..7724f1b7 100644 --- a/app/views/admin/users/edit.html.haml +++ b/app/views/admin/users/edit.html.haml @@ -1,3 +1,3 @@ -- title "Benutzerin bearbeiten" +- title t '.title' = render 'form' diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 207c5de6..d9a6805e 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,18 +1,16 @@ -- title "Admin/Benutzerinnen" +- title t '.title' - content_for :actionbar do - = link_to 'Neue Benutzerin anlegen', new_admin_user_path, class: 'btn btn-primary' + = link_to t('.new_user'), new_admin_user_path, class: 'btn btn-primary' - content_for :sidebar do - %p - Hier kannst du Benutzer_innen #{link_to 'neu Anlegen', new_admin_user_path}, - bearbeiten und natürlich auch löschen. + %p= t('.first_paragraph', url: link_to(t('.new_users'), new_admin_user_path)).html_safe .well.well-small = form_tag admin_users_path, :method => :get, :remote => true, 'data-submit-onchange' => true, class: 'form-search' do = text_field_tag :user_name, params[:user_name], class: 'input-medium search-query', - placeholder: 'Name ...' + placeholder: t('admin.search_placeholder') #users = render "users" \ No newline at end of file diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml index 9a83b451..438cf78d 100644 --- a/app/views/admin/users/new.html.haml +++ b/app/views/admin/users/new.html.haml @@ -1,3 +1,3 @@ -- title "Neue Benutzerin anlegen" +- title t '.title' = render 'form' \ No newline at end of file diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 0e1ee9c4..0992f338 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -3,37 +3,37 @@ .row-fluid .span3 .well - %h4 Person - %p Mitglied seit #{distance_of_time_in_words(Time.now, @user.created_on)} + %h4= t '.person' + %p= t '.member_since', time: distance_of_time_in_words(Time.now, @user.created_on) %dl - %dt Nick + %dt= t '.nick' %dd= @user.nick - %dt Name + %dt= t '.name' %dd= h @user.name - %dt Email + %dt= t '.email' %dd= @user.email - %dt Telefon + %dt= t '.phone' %dd= @user.phone - %dt Zugriff auf + %dt= t 'admin.access_to' %dd= format_roles(@user) .span5 .well - %h4 Einstellungen + %h4= t '.preference' %table.table - for setting in User::setting_keys.keys %tr %td= User::setting_keys[setting] - %td= @user.settings[setting] == '1' ? 'ja' : 'nein' + %td= @user.settings[setting] == '1' ? t('simple_form.yes') : t('simple_form.no') .span3 .well - %h4 Gruppenabos + %h4= t '.groupabos' %ul.unstyled - for membership in Membership.find_all_by_user_id(@user.id) %li= link_to(membership.group.name, [:admin, membership.group]) %hr/ %p - = link_to 'Bearbeiten', edit_admin_user_path(@user), class: 'btn' - = link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?", + = link_to t('admin.edit'), edit_admin_user_path(@user), class: 'btn' + = link_to t('admin.delete'), [:admin, @user], :confirm => t('.confirm', user: @user.first_name), :method => :delete, class: 'btn btn-danger' - = link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}), class: 'btn' + = link_to t('.send_message'), new_message_path(:message => {:mail_to => @user.id}), class: 'btn' diff --git a/app/views/admin/workgroups/_form.html.haml b/app/views/admin/workgroups/_form.html.haml index 2925136a..fcfea69a 100644 --- a/app/views/admin/workgroups/_form.html.haml +++ b/app/views/admin/workgroups/_form.html.haml @@ -1,7 +1,7 @@ %p= t('.first_paragraph', url: link_to(t('.here'), new_invite_path(id: @workgroup.id), remote: true)).html_safe = simple_form_for [:admin, @workgroup] do |f| = render :layout => 'shared/group_form_fields', :locals => {:f => f} do - %h4 Zugriff auf + %h4= t 'admin.access_to' = f.input :role_admin = f.input :role_finance = f.input :role_suppliers @@ -9,4 +9,4 @@ = f.input :role_orders .form-actions = f.button :submit - = link_to t('.or_cancel'), :back + = link_to t('admin.or_cancel'), :back diff --git a/app/views/admin/workgroups/_workgroups.html.haml b/app/views/admin/workgroups/_workgroups.html.haml index f5dadfc4..2aa42a5e 100644 --- a/app/views/admin/workgroups/_workgroups.html.haml +++ b/app/views/admin/workgroups/_workgroups.html.haml @@ -6,8 +6,8 @@ %tr %th= t '.name' %th= t '.members' - %th= t '.access_to' - %th= t '.actions' + %th= t 'admin.access_to' + %th= t 'admin.actions' %tbody - for workgroup in @workgroups %tr @@ -15,6 +15,6 @@ %td= workgroup.users.size %td= format_roles(workgroup) %td - = link_to t('.edit'), edit_admin_workgroup_path(workgroup), class: 'btn btn-mini' - = link_to t('.delete'), [:admin, workgroup], :confirm => t('.confirm', name: workgroup.name), + = link_to t('admin.edit'), edit_admin_workgroup_path(workgroup), class: 'btn btn-mini' + = link_to t('admin.delete'), [:admin, workgroup], :confirm => t('admin.confirm', name: workgroup.name), :method => :delete, class: 'btn btn-mini btn-danger' diff --git a/app/views/admin/workgroups/index.html.haml b/app/views/admin/workgroups/index.html.haml index 68abbf4e..80a27d6c 100644 --- a/app/views/admin/workgroups/index.html.haml +++ b/app/views/admin/workgroups/index.html.haml @@ -10,6 +10,6 @@ = form_tag admin_workgroups_path, :method => :get, :remote => true, 'data-submit-onchange' => true, class: 'form-search' do = text_field_tag :query, params[:query], class: 'input-medium search-query', - placeholder: t('.search_placeholder') + placeholder: t('admin.search_placeholder') #workgroups = render "workgroups" \ No newline at end of file diff --git a/config/locales/de/de.admin.yml b/config/locales/de/de.admin.yml index cfca6a56..22519841 100644 --- a/config/locales/de/de.admin.yml +++ b/config/locales/de/de.admin.yml @@ -1,5 +1,12 @@ de: admin: + edit: 'Bearbeiten' + delete: 'Löschen' + confirm: 'Willst du %{name} wirklich löschen?' + actions: 'Aktionen' + access_to: 'Zugriff auf' + or_cancel: 'oder abbrechen' + search_placeholder: 'Name ...' base: index: title: 'Administration' @@ -26,7 +33,6 @@ de: new_ordergroups: 'neue Bestellgruppen' second_paragraph: "Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer %{url} (z.b. 'Soritiergruppe') koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören." workgroup: 'Arbeitsgruppe' - search_placeholder: 'Name ...' edit: title: 'Bestellgruppe bearbeiten' new: @@ -34,7 +40,6 @@ de: form: first_paragraph: 'Neue Mitglieder kannst du %{url} einladen.' here: 'hier' - or_cancel: 'oder abbrechen' show: title: 'Bestellgruppe %{name}' edit: 'Gruppe/Mitglieder bearbeiten' @@ -46,10 +51,6 @@ de: contact: 'Kontakt' address: 'Adresse' members: 'Mitglieder' - actions: 'Aktionen' - edit: 'Bearbeiten' - delete: 'Löschen' - confirm: 'Willst du %{name} wirklich löschen?' workgroups: index: title: 'Arbeitsgruppen' @@ -58,7 +59,6 @@ de: new_workgroups: 'neue Arbeitsgruppen' second_paragraph: "Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: Eine %{url} hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe') koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören." ordergroup: 'Bestellgruppe' - search_placeholder: 'Name ...' edit: title: 'Arbeitsgruppe bearbeiten' new: @@ -66,7 +66,6 @@ de: form: first_paragraph: 'Neue Mitglieder kannst du %{url} einladen.' here: 'hier' - or_cancel: 'oder abbrechen' show: title: 'Arbeitsgruppe %{name}' edit: 'Gruppe/Mitglieder bearbeiten' @@ -75,8 +74,33 @@ de: workgroups: name: 'Name' members: 'Mitglieder' - access_to: 'Zugriff auf' - actions: 'Aktionen' - edit: 'Bearbeiten' - delete: 'Löschen' - confirm: 'Willst du %{name} wirklich löschen?' \ No newline at end of file + users: + index: + title: 'Admin/Benutzerinnen' + new_user: 'Neue Benutzerin anlegen' + first_paragraph: 'Hier kannst du Benutzer_innen %{url}, bearbeiten und natürlich auch löschen.' + new_users: 'neu anlegen' + edit: + title: 'Benutzerin bearbeiten' + new: + title: 'Neue Benutzerin anlegen' + form: + first_paragraph: 'Neue Mitglieder kannst du %{url} einladen.' + here: 'hier' + or_cancel: 'oder abbrechen' + show: + person: 'Person' + member_since: 'Mitglied seit %{time}' + nick: 'Nick' + name: 'Name' + email: 'Email' + phone: 'Telefon' + preference: 'Einstellungen' + groupabos: 'Gruppenabos' + confirm: 'Willst du %{user} wirklich rausschmeißen?' + send_message: 'Nachricht senden' + users: + login: 'Login' + name: 'Name' + email: 'Email' + last_login: 'Letzter login' \ No newline at end of file