diff --git a/app/models/workgroup.rb b/app/models/workgroup.rb index 5b201932..d154fe3e 100644 --- a/app/models/workgroup.rb +++ b/app/models/workgroup.rb @@ -14,7 +14,8 @@ class Workgroup < Group before_destroy :check_last_admin_group def self.weekdays - [["Montag", "1"], ["Dienstag", "2"], ["Mittwoch","3"],["Donnerstag","4"],["Freitag","5"],["Samstag","6"],["Sonntag","0"]] + days = I18n.t('date.day_names') + (0..days.length-1).map {|i| [days[i], i.to_s]} end # Returns an Array with date-objects to represent the next weekly-tasks @@ -54,7 +55,7 @@ class Workgroup < Group # Check before destroy a group, if this is the last group with admin role def check_last_admin_group if role_admin && Workgroup.where(:role_admin => true).size == 1 - raise "Die letzte Gruppe mit Admin-Rechten darf nicht gelöscht werden" + raise I18n.t('workgroups.error_last_admin_group') end end @@ -62,7 +63,7 @@ class Workgroup < Group # Return an error if this is the last group with admin role and role_admin should set to false def last_admin_on_earth if !role_admin && Workgroup.where(:role_admin => true, :id.ne => id).empty? - errors.add(:role_admin, "Der letzten Gruppe mit Admin-Rechten darf die Admin-Rolle nicht entzogen werden") + errors.add(:role_admin, I18n.t('workgroups.error_last_admin_role')) end end diff --git a/app/views/foodcoop/ordergroups/_ordergroups.html.haml b/app/views/foodcoop/ordergroups/_ordergroups.html.haml index 46841b72..7c7780ee 100644 --- a/app/views/foodcoop/ordergroups/_ordergroups.html.haml +++ b/app/views/foodcoop/ordergroups/_ordergroups.html.haml @@ -5,9 +5,9 @@ %table.table.table-striped %thead %tr - %th Name - %th Mitglieder - %th zuletzt bestellt + %th= t '.name' + %th= t '.user' + %th= t '.last_ordered' %tbody - for ordergroup in @ordergroups diff --git a/app/views/foodcoop/ordergroups/index.html.haml b/app/views/foodcoop/ordergroups/index.html.haml index 6516cee9..a20bbe97 100644 --- a/app/views/foodcoop/ordergroups/index.html.haml +++ b/app/views/foodcoop/ordergroups/index.html.haml @@ -1,13 +1,13 @@ -- title "Bestellgruppen" +- title t('.title') .well = form_tag foodcoop_ordergroups_path, :method => :get, :remote => true, 'data-submit-onchange' => true, class: 'form-search' do - = text_field_tag :name, params[:name], class: 'input-medium search-query', placeholder: 'Name ...' + = text_field_tag :name, params[:name], class: 'input-medium search-query', placeholder: t('.name') %label{:for => 'only_active'} = check_box_tag 'only_active', 1, params[:only_active] - Nur aktive - %small (mindestens einmal in den letzten 3 Monaten bestellt) + = t '.only_active' + %small= t '.only_active_desc' #ordergroups - = render :partial => "ordergroups" \ No newline at end of file + = render :partial => "ordergroups" diff --git a/app/views/foodcoop/users/_users.html.haml b/app/views/foodcoop/users/_users.html.haml index 2dd3df3e..487f15e4 100644 --- a/app/views/foodcoop/users/_users.html.haml +++ b/app/views/foodcoop/users/_users.html.haml @@ -4,12 +4,12 @@ %table.table.table-striped %thead %tr - %th Benutzername - %th Name - %th Email - %th Telefon - %th Bestellgruppe - %th Arbeitsgruppe(n) + %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 %tbody - for user in @users %tr diff --git a/app/views/foodcoop/users/index.html.haml b/app/views/foodcoop/users/index.html.haml index 464b08a4..8219cefa 100644 --- a/app/views/foodcoop/users/index.html.haml +++ b/app/views/foodcoop/users/index.html.haml @@ -1,23 +1,18 @@ -- title "Mitglieder" +- title t('.title') %section - %p - Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben. - %br/ - Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter - = link_to "Einstellungen", my_profile_path - freigeben. + = t('.body', profile_link: link_to(t('.profile_link'), my_profile_path)).html_safe .well = form_tag foodcoop_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('.ph_name') = text_field_tag :ordergroup_name, params[:ordergroup_name], class: 'input-medium search-query', - placeholder: 'Bestelllgruppe ...' + placeholder: t('.ph_ordergroup') %button.btn %i.icon-search #users - = render :partial => "users" \ No newline at end of file + = render :partial => "users" diff --git a/app/views/foodcoop/workgroups/_workgroup.html.haml b/app/views/foodcoop/workgroups/_workgroup.html.haml index 3a9cf1f9..38ba70fa 100644 --- a/app/views/foodcoop/workgroups/_workgroup.html.haml +++ b/app/views/foodcoop/workgroups/_workgroup.html.haml @@ -1,7 +1,7 @@ %section.well %h3= workgroup.name = render :partial => 'shared/group', :locals => { :group => workgroup } - = link_to "Alle Aufgaben zeigen", workgroup_tasks_path(workgroup_id: workgroup), class: 'btn' + = link_to t('.show_tasks'), workgroup_tasks_path(workgroup_id: workgroup), class: 'btn' = link_to_new_message message_params: {group_id: workgroup.id} - if workgroup.member?(current_user) - = link_to "Gruppe bearbeiten", edit_foodcoop_workgroup_path(workgroup), class: 'btn' + = link_to t('.edit'), edit_foodcoop_workgroup_path(workgroup), class: 'btn' diff --git a/app/views/foodcoop/workgroups/edit.html.haml b/app/views/foodcoop/workgroups/edit.html.haml index 2fed947b..87293331 100644 --- a/app/views/foodcoop/workgroups/edit.html.haml +++ b/app/views/foodcoop/workgroups/edit.html.haml @@ -1,11 +1,8 @@ -- title "Gruppe bearbeiten" +- title t('.title') -%p - Neue Mitglieder kannst du - = link_to "hier", new_invite_path(id: @workgroup.id) - einladen. +%p= t('.invite_new', invite_link: link_to(t('.invite_link'), new_invite_path(id: @workgroup.id))).html_safe = simple_form_for [:foodcoop, @workgroup] do |f| = render :partial => 'shared/group_form_fields', :locals => {:f => f} .form-actions = f.submit - = link_to "oder abbrechen", foodcoop_workgroups_path + = link_to t('.or_cancel'), foodcoop_workgroups_path diff --git a/app/views/foodcoop/workgroups/index.html.haml b/app/views/foodcoop/workgroups/index.html.haml index e8fd89d1..3eedf90d 100644 --- a/app/views/foodcoop/workgroups/index.html.haml +++ b/app/views/foodcoop/workgroups/index.html.haml @@ -1,12 +1,9 @@ -- title "Arbeitsgruppen" +- title t('.title') + += t('.body').html_safe -%p - Das bearbeiten von Gruppen ist nur für Mitglieder der Gruppe möglich. - %br/ - Wenn du einer Gruppe beitreten willst, dann schreib doch den Mitgliedern eine Nachricht. - = render :partial => "workgroup", :collection => @workgroups - \ No newline at end of file + diff --git a/config/locales/de/de.foodcoop.yml b/config/locales/de/de.foodcoop.yml new file mode 100644 index 00000000..7db9b577 --- /dev/null +++ b/config/locales/de/de.foodcoop.yml @@ -0,0 +1,35 @@ +de: + foodcoop: + ordergroups: + index: + title: 'Bestellgruppen' + name: Name ... + only_active: 'Nur aktive' + only_active_desc: '(mindestens einmal in den letzten 3 Monaten bestellt)' + ordergroups: + name: 'Name' + user: 'Mitglieder' + last_ordered: 'zuletzt bestellt' + users: + index: + title: 'Mitglieder' + body: +

Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben.

+

Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter %{profile_link} freigeben.

+ profile_link: 'Einstellungen' + ph_name: Name ... + ph_ordergroup: Bestellgruppe ... + workgroups: + index: + title: 'Arbeitsgruppen' + body: +

Das bearbeiten von Gruppen ist nur für Mitglieder der Gruppe möglich.
+ Wenn du einer Gruppe beitreten willst, dann schreib doch den Mitgliedern eine Nachricht.

+ edit: + title: 'Gruppe bearbeiten' + invite_new: 'Neue Mitglieder kannst du %{invite_link} einladen.' + invite_link: 'hier' + or_cancel: 'oder abbrechen' + workgroup: + show_tasks: 'Alle Aufgaben zeigen' + edit: 'Gruppe bearbeiten' diff --git a/config/locales/de/de.simple_form.yml b/config/locales/de/de.simple_form.yml index b7a602b5..9043f68e 100644 --- a/config/locales/de/de.simple_form.yml +++ b/config/locales/de/de.simple_form.yml @@ -93,7 +93,14 @@ de: delivered_on: 'Lieferdatum' user: nick: "Benutzername" + name: "Name" last_name: "Nachname" + email: 'Email' + phone: "Telefon" + ordergroup: 'Bestellgruppe' + workgroup: + one: 'Arbeitsgruppe' + other: 'Arbeitsgruppen' order_comment: text: Kommentiere diese Bestellung ... order: diff --git a/config/locales/de/de.workgroups.yml b/config/locales/de/de.workgroups.yml index 7ed65253..c6e8fc7e 100644 --- a/config/locales/de/de.workgroups.yml +++ b/config/locales/de/de.workgroups.yml @@ -8,3 +8,5 @@ de: # used by controller update: notice: 'Arbeitsgruppe wurde aktualisiert' + error_last_admin_group: 'Die letzte Gruppe mit Admin-Rechten darf nicht gelöscht werden' + error_last_admin_role: 'Der letzten Gruppe mit Admin-Rechten darf die Admin-Rolle nicht entzogen werden'