From 28c66642f596368e041a8ae3934b2c3fe9390cf5 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 8 Feb 2013 19:16:06 +0100 Subject: [PATCH] finish shared i18n --- .../shared/_articles_by_articles.html.haml | 10 +-- .../shared/_articles_by_groups.html.haml | 14 ++-- app/views/shared/_group.html.haml | 18 ++--- app/views/shared/_group_form_fields.html.haml | 8 +-- app/views/shared/_loginInfo.haml | 12 ++-- app/views/shared/_open_orders.html.haml | 17 ++--- app/views/shared/_workgroup_members.haml | 4 +- .../shared/memberships/_current_members.rhtml | 6 +- app/views/shared/memberships/_members.rhtml | 13 ++-- .../shared/memberships/_non_members.rhtml | 4 +- config/locales/de/de.shared.yml | 68 +++++++++++++++++++ 11 files changed, 120 insertions(+), 54 deletions(-) create mode 100644 config/locales/de/de.shared.yml diff --git a/app/views/shared/_articles_by_articles.html.haml b/app/views/shared/_articles_by_articles.html.haml index 18f4c8d1..df4528a3 100644 --- a/app/views/shared/_articles_by_articles.html.haml +++ b/app/views/shared/_articles_by_articles.html.haml @@ -1,10 +1,10 @@ %table.table.table-hover %thead %tr - %th{:style => 'width:70%'} Bestellgruppe - %th Bestellt (Menge + Toleranz) - %th Bekommen - %th Gesamtpreis + %th{:style => 'width:70%'}= t '.ordergroup' + %th= t '.ordered' + %th= t '.received' + %th= t '.price' - for order_article in order.order_articles.ordered.all(:include => [:article, :article_price]) %thead @@ -22,4 +22,4 @@ %td= number_to_currency(order_article.price.fc_price * goa.result) %tr %td(colspan="4" ) - - reset_cycle('groups') \ No newline at end of file + - reset_cycle('groups') diff --git a/app/views/shared/_articles_by_groups.html.haml b/app/views/shared/_articles_by_groups.html.haml index 15607a4a..c78f5a70 100644 --- a/app/views/shared/_articles_by_groups.html.haml +++ b/app/views/shared/_articles_by_groups.html.haml @@ -1,15 +1,15 @@ %table.table.table-hover %thead %tr - %th{:style => "width:40%"} Name + %th{:style => "width:40%"}= t '.name' %th - %acronym{:title => "zugeteilte Einheiten"} Menge + %acronym{:title => t('.units_desc')}= t '.units' %th - %acronym{:title => "Preis incl. MwSt, Pfand und Foodcoop-Aufschlag"} FC-Preis + %acronym{:title => t('.fc_price_desc')}= t '.fc_price' %th - %acronym{:title => "Gebindegröße"} GebGr - %th Einheit - %th Gesamtpreis + %acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity' + %th= t '.unit' + %th= t '.price' - for group_order in order.group_orders.all %thead @@ -35,4 +35,4 @@ %th= number_to_currency(total) %tr %th(colspan="6") - - reset_cycle("articles") \ No newline at end of file + - reset_cycle("articles") diff --git a/app/views/shared/_group.html.haml b/app/views/shared/_group.html.haml index 2f65403a..eebe4cac 100644 --- a/app/views/shared/_group.html.haml +++ b/app/views/shared/_group.html.haml @@ -1,25 +1,25 @@ %dl - %dt Beschreibung: + %dt= t('.description') + ':' %dd=h group.description - if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?) - %dt Kontakt: + %dt= t('.contact') + ':' %dd=h group.contact - %dt Adresse: + %dt= t('.address') + ':' %dd= link_to_gmaps group.contact_address - %dt Zugriff auf: + %dt= t('.access') + ':' %dd= format_roles(group) - %dt Mitglieder: + %dt= t('.members') + ':' %dd - members = group.users = "(#{members.size})" = members.collect(&:nick).join(", ") - if group.is_a?(Workgroup) - %dt wöchentlicher Job: + %dt= t('.weekly_job') + ':' %dd - if group.weekly_task =h "#{group.task_name} am #{weekday(group.weekday)}" - else - kein wöchentlicher Job definiert + = t '.no_weekly_job' - else - %dt Äpfel-Bestellbeschränkung - %dd= group.ignore_apple_restriction ? 'deaktiviert' : 'aktiviert' \ No newline at end of file + %dt= t '.apple_limit' + %dd= group.ignore_apple_restriction ? t('.deactivated') : t('.activated') diff --git a/app/views/shared/_group_form_fields.html.haml b/app/views/shared/_group_form_fields.html.haml index 8de6b874..8035a2c5 100644 --- a/app/views/shared/_group_form_fields.html.haml +++ b/app/views/shared/_group_form_fields.html.haml @@ -4,7 +4,7 @@ = yield - if f.object.is_a?(Workgroup) - %h3 Wöchentliche Jobs + %h3= t '.title' = f.input :weekly_task #weekly_task_fields = f.input :weekday, as: :select, collection: Workgroup.weekdays @@ -38,9 +38,9 @@ $("##{f.object.class.to_s.underscore}_user_tokens").tokenInput("#{users_path(:format => :json)}", { crossDomain: false, prePopulate: $("##{f.object.class.to_s.underscore}_user_tokens").data("pre"), - hintText: 'Nach Nutzerin suchen', - noResultText: 'Keine Nutzerin gefunden', - searchingText: 'Suche ...', + hintText: #{t('.search_user')}, + noResultText: #{t('.user_not_found')} + searchingText: #{t('.search')}, theme: 'facebook' }); }); diff --git a/app/views/shared/_loginInfo.haml b/app/views/shared/_loginInfo.haml index cf421d81..8ca136ec 100644 --- a/app/views/shared/_loginInfo.haml +++ b/app/views/shared/_loginInfo.haml @@ -1,9 +1,9 @@ %ul %li - = image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => "Profil" - = link_to h(@current_user.nick), my_profile_path, { :title => "Profil bearbeiten" } + = image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => t('.profile') + = link_to h(@current_user.nick), my_profile_path, { :title => t('.edit_profile') } - if FoodsoftConfig[:homepage] - %li= link_to FoodsoftConfig[:name], FoodsoftConfig[:homepage], { :title => "Go to your FoodCoop-Hompage" } - %li= link_to "Hilfe", 'http://dev.foodcoops.net/wiki/FoodsoftDoku' - %li= link_to "Feedback", new_feedback_path, :title => "Fehler gefunden? Vorschlag? Idee? Kritik?" - %li= link_to "Abmelden", logout_path \ No newline at end of file + %li= link_to FoodsoftConfig[:name], FoodsoftConfig[:homepage], { :title => t('.homepage_title') } + %li= link_to t('.help'), FoodsoftConfig[:help_url] + %li= link_to t('.feedback.title'), new_feedback_path, :title => t('.feedback.desc') + %li= link_to t('.logout'), logout_path diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index ae07971b..ebda2730 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -1,15 +1,16 @@ %section - %h2 Laufende Bestellungen + %h2= t '.title' - if ordergroup.not_enough_apples? - .alert Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können! + .alert + = t '.not_enough_apples' - unless Order.open.empty? %table.table.table-striped %thead %tr - %th Lieferantin - %th Ende - %th Wer hat bestellt? - %th Summe + %th= t '.supplier' + %th= t '.ending' + %th= t '.who_ordered' + %th= t '.total' %tbody - total = 0 - Order.open.each do |order| @@ -26,7 +27,7 @@ %tfooter %tr %th(colspan="2") - %th Gesamtsumme: + %th= t('.total_sum') + ':' %th.numeric= number_to_currency(total) - else - %i Derzeit gibt es keine laufenden Bestellungen \ No newline at end of file + %i= t '.no_open_orders' diff --git a/app/views/shared/_workgroup_members.haml b/app/views/shared/_workgroup_members.haml index 525133f8..960113d8 100644 --- a/app/views/shared/_workgroup_members.haml +++ b/app/views/shared/_workgroup_members.haml @@ -1,5 +1,5 @@ .well.well-small - %h4 Mitglieder der Gruppen + %h4= t '.title' #groupMembers.accordion - Workgroup.all.each do |workgroup| .accordion-group @@ -11,4 +11,4 @@ - workgroup.users.includes(:groups).order('nick').each do |user| %li = user.nick - %small (#{user.ordergroup.try(:name)}) \ No newline at end of file + %small (#{user.ordergroup.try(:name)}) diff --git a/app/views/shared/memberships/_current_members.rhtml b/app/views/shared/memberships/_current_members.rhtml index 6560e150..81aab3a0 100644 --- a/app/views/shared/memberships/_current_members.rhtml +++ b/app/views/shared/memberships/_current_members.rhtml @@ -9,7 +9,7 @@ <% for membership in memberships %>
  • <%= membership.user.nick %> (<%=h membership.user.first_name + ' ' + membership.user.last_name %>) - | <%= link_to_remote 'entfernen', + | <%= link_to_remote t('.drop'), :url => { :controller => '/memberships', :action => 'drop_member', :id => @group, :membership_id => membership }, :before => "Element.show('loader')", :success => "Element.hide('loader')" %> @@ -17,5 +17,5 @@ <% end %> <% else %> -

    <%= @group.name %> hat keine Mitglieder.

    - <% end %> \ No newline at end of file +

    <%= t('.no_members', group: @group.name) %>

    + <% end %> diff --git a/app/views/shared/memberships/_members.rhtml b/app/views/shared/memberships/_members.rhtml index b3229860..55a35452 100644 --- a/app/views/shared/memberships/_members.rhtml +++ b/app/views/shared/memberships/_members.rhtml @@ -1,13 +1,10 @@ -

    Mitglieder von <%=h @group.name %>

    +

    <%=h t('.title', group: @group.name) %>

    - - Hier kannst Du die Mitglieder der Gruppe verwalten oder ein neues Foodcoop-Mitglied in die Gruppe - <%= remote_link_to('einladen', :url => new_invite_path(:id => @group)) %>. - + <%= t('.desc', link: remote_link_to(t('.invite'), :url => new_invite_path(:id => @group))).html_safe %>

    -

    Sind schon Mitglieder

    +

    <%= t('.already_members') %>

    <%=render :partial => 'shared/memberships/current_members' %> @@ -15,11 +12,11 @@
    -

    Sind noch keine Mitglieder

    +

    <%= t('.no_members_yet') %>

    <%= render :partial => 'shared/memberships/non_members' %> - <%= remote_link_to('Person einladen', :url => new_invite_path(:id => @group)) %> + <%= remote_link_to(t('.invite_someone'), :url => new_invite_path(:id => @group)) %>
    diff --git a/app/views/shared/memberships/_non_members.rhtml b/app/views/shared/memberships/_non_members.rhtml index e96b2d89..2e177bc2 100644 --- a/app/views/shared/memberships/_non_members.rhtml +++ b/app/views/shared/memberships/_non_members.rhtml @@ -2,10 +2,10 @@ <% for user in @group.non_members %>
  • <%= user.nick %> (<%=h user.first_name + ' ' + user.last_name %>) - | <%= link_to_remote 'hinzufügen', + | <%= link_to_remote t('.add'), :url => { :controller => '/memberships', :action => 'add_member', :id => @group, :user_id => user }, :before => "Element.show('loader')", :success => "Element.hide('loader')" %>
  • <% end %> - \ No newline at end of file + diff --git a/config/locales/de/de.shared.yml b/config/locales/de/de.shared.yml new file mode 100644 index 00000000..87b99176 --- /dev/null +++ b/config/locales/de/de.shared.yml @@ -0,0 +1,68 @@ +de: + shared: + articles_by_articles: + ordergroup: 'Bestellgruppe' + ordered: 'Bestellt (Menge + Toleranz)' + received: 'Bekommen' + price: 'Gesamtpreis' + articles_by_groups: + name: 'Name' + units: 'Menge' + units_desc: 'Zugeteilte Einheiten' + fc_price: 'FC-Preis' + fc_price_desc: 'Preis incl. MwSt, Pfand und Foodcoop-Aufschlag' + unit_quantity: 'GebGr' + unit_quantity_desc: 'Gebindegröße' + unit: 'Einheit' + price: 'Gesamtpreis' + group_form_fields: + title: 'Wöchentliche Jobs' + search_user: 'Nach Nutzerin suchen' + user_not_found: 'Keine Nutzerin gefunden' + search: 'Suche ...' + group: + description: 'Beschreibung' + contact: 'Kontakt' + address: 'Adresse' + access: 'Zugriff auf' + members: 'Mitglieder' + weekly_job: 'wöchentlicher Job' + no_weekly_job: 'kein wöchentlicher Job definiert' + apple_limit: 'Äpfel-Bestellbeschränkung' + deactivated: 'deaktiviert' + activated: 'aktiviert' + loginInfo: + profile: 'Profil' + edit_profile: 'Profil bearbeiten' + homepage_title: 'Foodcoop Homepage besuchen' + # duplicate from de.layouts.header + logout: 'Abmelden' + help: 'Hilfe' + feedback: + title: 'Feedback' + desc: 'Fehler gefunden? Vorschlag? Idee? Kritik?' + open_orders: + title: 'Laufende Bestellungen' + not_enough_apples: 'Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können!' + supplier: 'Lieferantin' + ending: 'Ende' + who_ordered: 'Wer hat bestellt?' + total: 'Summe' + total_sum: 'Gesamtsumme' + no_open_orders: 'Derzeit gibt es keine laufenden Bestellungen' + workgroup_members: + title: 'Mitglieder der Gruppen' + + memberships: + current_members: + drop: 'entfernen' + no_members: '%{group} hat keine Mitglieder.' + members: + title: 'Mitglieder von %{group}' + desc: 'Hier kannst Du Mitglieder der Gruppe verwalten oder ein neues Foodcoop-Mitglied in die Gruppe %{link}.' + invite: 'einladen' + already_members: 'Sind schon Mitglieder' + no_members_yet: 'Sind noch keine Mitglieder' + invite_someone: 'Person einladen' + non_members: + add: 'hinzufügen'