From 6632f5ed7568eb8fdceb0b6510e0dab6bdb409d9 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 30 Sep 2013 10:57:54 +0200 Subject: [PATCH 1/9] workaround migration bug introduced by 975bcdec3a484960259e88c5d0b4d33c0e60da30 --- lib/tasks/foodsoft.rake | 8 ++++---- lib/tasks/multicoops.rake | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/tasks/foodsoft.rake b/lib/tasks/foodsoft.rake index df05c1fd..1fdd2259 100644 --- a/lib/tasks/foodsoft.rake +++ b/lib/tasks/foodsoft.rake @@ -5,12 +5,12 @@ namespace :foodsoft do task :notify_upcoming_tasks => :environment do tasks = Task.where(done: false, due_date: 1.day.from_now.to_date) for task in tasks - say "Send notifications for #{task.name} to .." + rake_say "Send notifications for #{task.name} to .." for user in task.users begin Mailer.upcoming_tasks(user, task).deliver if user.settings.notify['upcoming_tasks'] == 1 rescue - say "deliver aborted for #{user.email}.." + rake_say "deliver aborted for #{user.email}.." end end end @@ -27,7 +27,7 @@ namespace :foodsoft do begin Mailer.not_enough_users_assigned(task, user).deliver rescue - say "deliver aborted for #{user.email}" + rake_say "deliver aborted for #{user.email}" end end end @@ -49,6 +49,6 @@ namespace :foodsoft do end # Helper -def say(message) +def rake_say(message) puts message unless Rake.application.options.silent end diff --git a/lib/tasks/multicoops.rake b/lib/tasks/multicoops.rake index 130daf40..a14020b7 100644 --- a/lib/tasks/multicoops.rake +++ b/lib/tasks/multicoops.rake @@ -8,7 +8,7 @@ namespace :multicoops do task :run => :environment do task_to_run = ENV['TASK'] FoodsoftConfig.each_coop do |coop| - say "Run '#{task_to_run}' for #{coop}" + rake_say "Run '#{task_to_run}' for #{coop}" Rake::Task[task_to_run].execute end end @@ -17,7 +17,7 @@ namespace :multicoops do task :run_single => :environment do task_to_run = ENV['TASK'] FoodsoftConfig.select_foodcoop ENV['FOODCOOP'] - say "Run '#{task_to_run}' for #{ENV['FOODCOOP']}" + rake_say "Run '#{task_to_run}' for #{ENV['FOODCOOP']}" Rake::Task[task_to_run].execute end @@ -25,6 +25,6 @@ end # Helper -def say(message) - puts message unless Rake.application.options.silent +def rake_say(message) + puts message unless Rake.application.options.silent end From d36f2dd4acc1ff21f2e54b5c3e8e01b018a5e0e5 Mon Sep 17 00:00:00 2001 From: Julius Date: Wed, 25 Sep 2013 23:06:53 +0200 Subject: [PATCH 2/9] Fix minor delivery bug --- app/views/deliveries/add_stock_change.js.erb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/views/deliveries/add_stock_change.js.erb b/app/views/deliveries/add_stock_change.js.erb index 049e6233..3e233bb6 100644 --- a/app/views/deliveries/add_stock_change.js.erb +++ b/app/views/deliveries/add_stock_change.js.erb @@ -5,21 +5,19 @@ $('#stock_changes tr').removeClass('success'); + var quantity = w.prompt('<%= j(t('.how_many_units', :unit => @stock_change.stock_article.unit, :name => @stock_change.stock_article.name)) %>'); + if(null === quantity) { + return false; + } + var stock_change = $( '<%= j(render(:partial => 'stock_change', :locals => {:stock_change => @stock_change})) %>' ).addClass('success'); enablePriceTooltips(stock_change); + $('input.stock-change-quantity', stock_change).val(quantity); $('#stock_changes').append(stock_change); mark_article_for_delivery(<%= @stock_change.stock_article.id %>); updateSort('#stock_changes'); - var quantity = w.prompt('<%= j(t('.how_many_units', :unit => @stock_change.stock_article.unit, :name => @stock_change.stock_article.name)) %>'); <%# how to properly escape here? %> - if(null === quantity) { - stock_change.remove(); - mark_article_for_delivery(<%= @stock_change.stock_article.id %>); - return false; - } - $('input.stock-change-quantity', stock_change).val(quantity); - })(window); From 0bb62332c04b280e9325e09d9cfbe30920dd0901 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 1 Oct 2013 00:05:46 +0200 Subject: [PATCH 3/9] localeapp roundtrip --- config/locales/en.yml | 12 ++-- config/locales/fr.yml | 4 +- config/locales/nl.yml | 142 +++++++++++++++++++++--------------------- 3 files changed, 79 insertions(+), 79 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 02a5bb1f..c3dcfadf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -430,7 +430,7 @@ en: create: notice: Delivery was created. Please don’t forget to create invoice! create_stock_article: - notice: The new stock article »%{name}« was saved. + notice: The new stock article "%{name}" was saved. destroy: notice: Delivery was deleted. edit: @@ -478,7 +478,7 @@ en: update: notice: Delivery was updated. update_stock_article: - notice: The stock article »%{name}« was updated. + notice: The stock article "%{name}" was updated. documents: order_by_articles: filename: Order %{name}-%{date} - by articles @@ -1313,7 +1313,7 @@ en: prices: Prices (net/FC) select_all: Select all stockit: In stock - supplier: Supplier + supplier: Producer title: Article unit_quantity: Unit quantity index: @@ -1395,7 +1395,7 @@ en: notice: Page was created cshow: error_noexist: Page doesn’t exist! - redirect_notice: Redirected from %{page} .. + redirect_notice: Redirected from %{page} ... destroy: notice: The page '%{page}' and all subpages have been deleted successfully. edit: @@ -1536,7 +1536,7 @@ en: message: private: Message doesn’t show in Foodsoft mail inbox order_article: - units_to_order: If you change the total amount of delivered units, you also have to change individual group amounts by clicking on the article name. They will not be automatically recalculated and otherwise ordergroups will be accounted for undelivered articles! + units_to_order: If you change the total amount of delivered units, you also have to change individual group amounts by clicking on the article name. They will not be automatically recalculated and so ordergroups may be accounted for articles that were not delivered! update_current_price: Also update the price of the current order stock_article: copy_stock_article: @@ -1866,7 +1866,7 @@ en: title: Show task update: notice: Task has been updated - notice_converted: Task has been updated and was converted to a regular task + notice_converted: Task has been updated and was converted to a non-repeating task. user: more: Nothing to do? %{tasks_link} are tasks for sure. tasks_link: Here diff --git a/config/locales/fr.yml b/config/locales/fr.yml index fe52e77e..7ba4c3c7 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1288,7 +1288,7 @@ fr: article_count: ! 'Articles commandés:' name: Nom prices: Prix brut/net - prices_sum: Totaux (des prix bruts/nets) + prices_sum: ! 'Totaux (des prix bruts/nets):' unit_quantity: Unités par lots x Lots units_full: Lots complet units_ordered: Unités commandées @@ -1536,7 +1536,7 @@ fr: message: private: Le message n'apparaîtra pas dans la boîte de réception du Foodsoft order_article: - units_to_order: Nombre de lots livrés + units_to_order: update_current_price: Modifie aussi le prix des commandes en cours stock_article: copy_stock_article: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index c2f0ee5b..f6e29a95 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -428,11 +428,11 @@ nl: add_stock_change: how_many_units: create: - notice: + notice: Levering is aangemaakt. Vergeet niet een factuur te maken! create_stock_article: - notice: + notice: Nieuw voorraadsartikel "%{name}" gemaakt. destroy: - notice: + notice: Levering is verwijdered. edit: title: form: @@ -476,7 +476,7 @@ nl: remove_article: suppliers_overview: update: - notice: + notice: Levering is bijgewerkt. update_stock_article: notice: documents: @@ -1061,7 +1061,7 @@ nl: text1: messages: create: - notice: + notice: Bericht is opgeslagen en wordt verzonden. index: new: title: @@ -1078,9 +1078,9 @@ nl: subscribe: subscribe_msg: wiki: - no_user_found: - search: - search_user: + no_user_found: Geen gebruiker gevonden + search: Zoeken ... + search_user: Gebruiker zoeken title: show: all_messages: @@ -1091,15 +1091,15 @@ nl: title: model: delivery: - each_stock_article_must_be_unique: + each_stock_article_must_be_unique: In een levering mag ieder voorraadsartikel maar een keer voorkomen. membership: - no_admin_delete: + no_admin_delete: Lidmaatschap kan niet beeindigd worden. Je bent de laatste administrator. order_article: - error_price: + error_price: moet ingevuld worden en een huidige prijs hebben page: - redirect: + redirect: Doorverwijzing naar [[%{title}]]... user: - no_ordergroup: + no_ordergroup: geen huishouden navigation: admin: home: Overzicht @@ -1187,46 +1187,46 @@ nl: delimiter: ordergroups: edit: - title: + title: Huidhouden bewerken index: - title: + title: Huishoudens model: - error_single_group: - invalid_balance: + error_single_group: ! '%{user} behoort al tot een ander huishouden' + invalid_balance: is geen geldig nummer orders: articles: - article_count: - name: - prices: - prices_sum: - unit_quantity: - units_full: - units_ordered: + article_count: ! 'Bestelde artikelen:' + name: Naam + prices: Netto/bruto prijs + prices_sum: ! 'Totaal (netto/bruto prijs):' + unit_quantity: Groothandelseenheid + units_full: Volle eenheden + units_ordered: Bestelde eenheden create: - notice: + notice: De bestelling is aangemaakt. edit: - title: + title: Bestelling aanpassen fax: - amount: - articles: - customer_number: - delivery_day: - heading: - name: - number: - to_address: + amount: Aantal + articles: Artikelen + customer_number: Klantnummer + delivery_day: Bezorgdag + heading: Bestelling voor %{name} + name: Naam + number: Nummer + to_address: Verzendadres finish: notice: De bestelling is gesloten. form: - ignore_warnings: - name: - note: - origin: - prices: - select_all: - stockit: - supplier: - title: + ignore_warnings: Waarschuwingen negeren + name: Naam + note: Notitie + origin: Herkomst + prices: Prijs (netto/FC) + select_all: Alles selecteren + stockit: Beschikbaar + supplier: Producent + title: Artikel unit_quantity: index: action_end: @@ -1244,7 +1244,7 @@ nl: error_closed: Bestelling was al afgerekend error_nosel: error_starts_before_ends: - notice_close: + notice_close: ! 'Bestelling: %{name}, tot %{ends}' stock: Voorraad warning_ordered: warning_ordered_stock: @@ -1288,7 +1288,7 @@ nl: finished: gesloten open: lopend update: - notice: + notice: De bestelling is bijgewerkt. pages: all: new_page: @@ -1302,12 +1302,12 @@ nl: body: title_toc: create: - notice: + notice: Pagina is gemaakt. cshow: error_noexist: - redirect_notice: + redirect_notice: Doorverwezen van %{page} ... destroy: - notice: + notice: De pagina '%{page}' en alle subpagina's zijn verwijderd. edit: title: error_stale_object: @@ -1351,7 +1351,7 @@ nl: versions: title: update: - notice: + notice: Pagina is bijgewerkt. version: author: date_format: @@ -1394,11 +1394,11 @@ nl: address: Adres apple_limit: contact: Contact - deactivated: - description: + deactivated: inactief + description: Beschrijving members: Leden - no_weekly_job: - weekly_job: + no_weekly_job: geen wekelijkse taak ingesteld + weekly_job: wekelijkse taak group_form_fields: search: Zoeken ... search_user: Gebruiker zoeken @@ -1407,8 +1407,8 @@ nl: loginInfo: edit_profile: Profiel aanpassen feedback: - desc: - title: + desc: Fout gevonden? Opmerking? Idee? + title: Feedback help: Help homepage_title: Foodcoop startpagina bezoeken logout: Uitloggen @@ -1436,7 +1436,7 @@ nl: total_sum: Totaalsom who_ordered: Wie heeft besteld? workgroup_members: - title: + title: Groepsleden simple_form: error_notification: default_message: @@ -1550,7 +1550,7 @@ nl: address: contact_person: customer_number: - delivery_days: + delivery_days: Bezorgdagen email: fax: is_subscribed: @@ -1601,7 +1601,7 @@ nl: 'yes': Ja stock_takings: create: - notice: + notice: Inventarisatie is aangelegd. edit: title: index: @@ -1629,12 +1629,12 @@ nl: date: note: update: - notice: + notice: Inventarisatie is bijgewerkt. stockit: check: not_empty: destroy: - notice: + notice: Artikel %{name} is verwijdered. edit: title: form: @@ -1674,14 +1674,14 @@ nl: search_text: title: stock_create: - notice: + notice: Voorraadsartikel is opgeslagen. stock_update: - notice: + notice: Voorraadsartikel is bijgewerkt. suppliers: create: - notice: + notice: Leverancier is aangemaakt. destroy: - notice: + notice: Leverancier is verwijderd edit: title: index: @@ -1707,7 +1707,7 @@ nl: new_delivery: show_deliveries: update: - notice: + notice: Leverancier is bijgewerkt support: array: last_word_connector: @@ -1715,7 +1715,7 @@ nl: words_connector: tasks: accept: - notice: + notice: Je hebt de taak geaccepteerd archive: title: archive_tasks: @@ -1724,9 +1724,9 @@ nl: task_format: who: create: - notice: + notice: Taak is aangemaakt destroy: - notice: + notice: Taak is verwijderd edit: title: warning_periodic: @@ -1764,7 +1764,7 @@ nl: title: repeated: set_done: - notice: + notice: De status van de taak is aangepast show: accept_task: confirm_delete_group: @@ -1775,8 +1775,8 @@ nl: reject_task: title: update: - notice: - notice_converted: + notice: Taak is bijgewerkt + notice_converted: Taak is bijgewerkt en omgezet naar een eenmalige taak. user: more: tasks_link: From 9ac9d1ea50413f32169f7c98edeadad11bc7d248 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 16:32:01 +0200 Subject: [PATCH 4/9] add spec for foodcoops/foodsoft#179 --- spec/integration/balancing_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/integration/balancing_spec.rb b/spec/integration/balancing_spec.rb index 2bf860be..eba7973e 100644 --- a/spec/integration/balancing_spec.rb +++ b/spec/integration/balancing_spec.rb @@ -103,6 +103,23 @@ describe 'settling an order', :type => :feature do expect(GroupOrderArticle.exists?(goa1.id)).to be_false end + it 'keeps product when amount is set to zero' do + within("#order_article_#{oa.id}") do + click_link I18n.t('ui.edit') + end + within("#edit_order_article_#{oa.id}") do + fill_in :order_article_units_to_order, :with => 0 + find('input[type="submit"]').click + end + expect(page).to have_selector("#order_article_#{oa.id}") + # make sure it still works after reloading + visit new_finance_order_path(order_id: order.id) + expect(page).to have_selector("#order_article_#{oa.id}") + expect(OrderArticle.exists?(oa.id)).to be_true + oa.reload + expect(oa.units_to_order).to eq(0) + end + end end From 6cfaa4979a6e76a7f2987ecaef413bdbafcf80fc Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 16:32:29 +0200 Subject: [PATCH 5/9] show lines with zero units but with member orders in balancing screen (closes foodcoops/foodsoft#179) --- app/controllers/finance/balancing_controller.rb | 2 +- app/models/order_article.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 8528e4d3..8de1444c 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -10,7 +10,7 @@ class Finance::BalancingController < Finance::BaseController flash.now.alert = t('finance.balancing.new.alert') if @order.closed? @comments = @order.comments - @articles = @order.order_articles.ordered.includes(:article, :article_price, + @articles = @order.order_articles.ordered_or_member.includes(:article, :article_price, group_order_articles: {group_order: :ordergroup}) sort_param = params['sort'] || 'name' diff --git a/app/models/order_article.rb b/app/models/order_article.rb index 85a0da79..bd90706b 100644 --- a/app/models/order_article.rb +++ b/app/models/order_article.rb @@ -12,7 +12,8 @@ class OrderArticle < ActiveRecord::Base validate :article_and_price_exist validates_uniqueness_of :article_id, scope: :order_id - scope :ordered, :conditions => "units_to_order >= 1" + scope :ordered, :conditions => "units_to_order > 0" + scope :ordered_or_member, -> { includes(:group_order_articles).where("units_to_order > 0 OR group_order_articles.result > 0") } before_create :init_from_balancing after_destroy :update_ordergroup_prices From 1d8fefcfb74a50d57108a0a2dc7078098ac83c7b Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 17:08:24 +0200 Subject: [PATCH 6/9] small i18n update --- app/views/invites/new.html.haml | 2 +- config/locales/de.yml | 1 - config/locales/en.yml | 1 - config/locales/fr.yml | 1 - config/locales/nl.yml | 1 - 5 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/invites/new.html.haml b/app/views/invites/new.html.haml index eb9081cb..2332db00 100644 --- a/app/views/invites/new.html.haml +++ b/app/views/invites/new.html.haml @@ -4,4 +4,4 @@ = form.hidden_field :group_id = form.input :email = form.submit t('.action') - = link_to t('.back'), :back + = link_to t('ui.or_cancel'), :back diff --git a/config/locales/de.yml b/config/locales/de.yml index 1663cc07..d46ea8d3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -971,7 +971,6 @@ de: title: Person einladen new: action: Einlading abschicken - back: oder zurück body:

Hier kannst du eine Person in die Gruppe %{group} einladen, die noch nicht Mitglied der Foodcoop ist.

success: Benutzerin wurde erfolgreich eingeladen. layouts: diff --git a/config/locales/en.yml b/config/locales/en.yml index c3dcfadf..bdb867c3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -975,7 +975,6 @@ en: title: Invite person new: action: Send invite - back: or go back body:

Here you can add a person to the group %{group}, who is not yet a member of the foodcoop.

success: User was invited successfully. layouts: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7ba4c3c7..f4d809c4 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -994,7 +994,6 @@ fr: title: Engrainer une personne new: action: Engrainer! - back: ou revenir en arrière body:

Sur cette page, tu peux engrainer une personne qui ne fait pas encore partie de la Boufcoop à rejoindre la cellule %{group} success: La_le membre a été engrainéE avec succès! layouts: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index f6e29a95..abf19a21 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -972,7 +972,6 @@ nl: title: new: action: - back: body: success: layouts: From a8ace3bc79309b9df163458e6716cff863084656 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 17:13:49 +0200 Subject: [PATCH 7/9] add missing i18n --- app/controllers/application_controller.rb | 6 +++--- config/locales/de.yml | 5 +++++ config/locales/en.yml | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 96b2e510..9c77fe48 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base def deny_access session[:return_to] = request.original_url - redirect_to login_url, :alert => 'Access denied!' + redirect_to login_url, :alert => I18n.t('application.controller.error_denied') end private @@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base # No user at all: redirect to login page. session[:user_id] = nil session[:return_to] = request.original_url - redirect_to login_url, :alert => 'Authentication required!' + redirect_to login_url, :alert => I18n.t('application.controller.error_authn') else # We have an authenticated user, now check role... # Roles gets the user through his memberships. @@ -83,7 +83,7 @@ class ApplicationController < ActionController::Base def authenticate_membership_or_admin @group = Group.find(params[:id]) unless @group.member?(@current_user) or @current_user.role_admin? - redirect_to root_path, alert: "Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!" + redirect_to root_path, alert: I18n.t('application.controller.error_members_only') end end diff --git a/config/locales/de.yml b/config/locales/de.yml index d46ea8d3..f562bf87 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -212,6 +212,11 @@ de: workgroups: members: Mitglieder name: Name + application: + controller: + error_denied: + error_authn: + error_members_only: 'Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!' article_categories: create: notice: Die Kategorie wurde gespeichert diff --git a/config/locales/en.yml b/config/locales/en.yml index bdb867c3..e42480e3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -212,6 +212,11 @@ en: workgroups: members: members name: name + application: + controller: + error_denied: 'Access denied!' + error_authn: 'Authentication required!' + error_members_only: 'This action is only available to members of the group!' article_categories: create: notice: Category was stored From 17bbb0705b960cc80aefa54aa15e585ff111fa4a Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 17:23:49 +0200 Subject: [PATCH 8/9] fix i18n --- .../finance/financial_transactions_controller.rb | 8 ++++---- config/locales/de.yml | 12 +++++++----- config/locales/en.yml | 12 +++++++----- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/controllers/finance/financial_transactions_controller.rb b/app/controllers/finance/financial_transactions_controller.rb index a129a49d..8865958e 100644 --- a/app/controllers/finance/financial_transactions_controller.rb +++ b/app/controllers/finance/financial_transactions_controller.rb @@ -34,7 +34,7 @@ class Finance::FinancialTransactionsController < ApplicationController @financial_transaction = FinancialTransaction.new(params[:financial_transaction]) @financial_transaction.user = current_user @financial_transaction.add_transaction! - redirect_to finance_ordergroup_transactions_url(@ordergroup), notice: t('finance.financial_transactions.create.notice') + redirect_to finance_ordergroup_transactions_url(@ordergroup), notice: I18n.t('finance.financial_transactions.controller.create.notice') rescue ActiveRecord::RecordInvalid => error flash.now[:alert] = error.message render :action => :new @@ -44,16 +44,16 @@ class Finance::FinancialTransactionsController < ApplicationController end def create_collection - raise "Notiz wird benötigt!" if params[:note].blank? + raise I18n.t('finance.financial_transactions.controller.create_collection.error_note_required') if params[:note].blank? params[:financial_transactions].each do |trans| # ignore empty amount fields ... unless trans[:amount].blank? Ordergroup.find(trans[:ordergroup_id]).add_financial_transaction!(trans[:amount], params[:note], @current_user) end end - redirect_to finance_ordergroups_url, notice: t('finance.create_collection.create.notice') + redirect_to finance_ordergroups_url, notice: I18n.t('finance.financial_transactions.controller.create_collection.notice') rescue => error - redirect_to finance_new_transaction_collection_url, alert: t('finance.create_collection.create.alert', error: error.to_s) + redirect_to finance_new_transaction_collection_url, alert: I18n.t('finance.financial_transactions.controller.create_collection.alert', error: error.to_s) end protected diff --git a/config/locales/de.yml b/config/locales/de.yml index f562bf87..b956b3f3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -649,11 +649,13 @@ de: create: notice: Rechnung wurde erstellt. financial_transactions: - create: - notice: Die Transaktion wurde gespeichert. - create_collection: - alert: ! 'Ein Fehler ist aufgetreten: %{error}' - notice: Alle Transaktionen wurden gespeichert. + controller: + create: + notice: Die Transaktion wurde gespeichert. + create_collection: + alert: ! 'Ein Fehler ist aufgetreten: %{error}' + error_note_required: ! 'Notiz wird benötigt!' + notice: Alle Transaktionen wurden gespeichert. index: balance: ! 'Kontostand: %{balance}' last_updated_at: (zuletzt aktualisiert vor %{when}) diff --git a/config/locales/en.yml b/config/locales/en.yml index e42480e3..2c89b7f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -653,11 +653,13 @@ en: create: notice: Invoice was created financial_transactions: - create: - notice: The transaction was saved. - create_collection: - alert: ! 'An error occured: %{error}' - notice: All transactions were saved. + controller: + create: + notice: The transaction was saved. + create_collection: + alert: ! 'An error occured: %{error}' + error_note_required: ! 'Note is required!' + notice: All transactions were saved. index: balance: ! 'Balance of account: %{balance}' last_updated_at: (last updated %{when} ago) From 3574f239c6fa7e309a43937383b9bf29c274fc4e Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 17:33:37 +0200 Subject: [PATCH 9/9] localeapp roundtrip --- config/locales/de.yml | 8 ++--- config/locales/en.yml | 10 +++--- config/locales/fr.yml | 17 +++++++--- config/locales/nl.yml | 77 ++++++++++++++++++++++++++++--------------- 4 files changed, 72 insertions(+), 40 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index b956b3f3..a0a0e3a7 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -214,9 +214,9 @@ de: name: Name application: controller: - error_denied: - error_authn: - error_members_only: 'Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!' + error_authn: + error_denied: + error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt! article_categories: create: notice: Die Kategorie wurde gespeichert @@ -654,7 +654,7 @@ de: notice: Die Transaktion wurde gespeichert. create_collection: alert: ! 'Ein Fehler ist aufgetreten: %{error}' - error_note_required: ! 'Notiz wird benötigt!' + error_note_required: Notiz wird benötigt! notice: Alle Transaktionen wurden gespeichert. index: balance: ! 'Kontostand: %{balance}' diff --git a/config/locales/en.yml b/config/locales/en.yml index 2c89b7f1..b13f4707 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -214,9 +214,9 @@ en: name: name application: controller: - error_denied: 'Access denied!' - error_authn: 'Authentication required!' - error_members_only: 'This action is only available to members of the group!' + error_authn: Authentication required! + error_denied: Access denied! + error_members_only: This action is only available to members of the group! article_categories: create: notice: Category was stored @@ -658,7 +658,7 @@ en: notice: The transaction was saved. create_collection: alert: ! 'An error occured: %{error}' - error_note_required: ! 'Note is required!' + error_note_required: Note is required! notice: All transactions were saved. index: balance: ! 'Balance of account: %{balance}' @@ -905,7 +905,7 @@ en: warning: Warning, if you have less then %{threshold} of apple points, you are not allowed to place an order! changes_saved: Changes saved. index: - due_date_format: ! '%A %d %b' + due_date_format: ! '%A %d %B' messages: title: Newest Messages view_all: See all messages diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f4d809c4..18e2cfea 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -212,6 +212,11 @@ fr: workgroups: members: membres name: nom + application: + controller: + error_authn: + error_denied: + error_members_only: article_categories: create: notice: La catégorie a bien été définie. @@ -655,11 +660,13 @@ fr: create: notice: La facture a bien été définie. financial_transactions: - create: - notice: La transaction a été sauvegardée. - create_collection: - alert: ! 'Une erreur s''est produite: %{error}' - notice: Les transactions ont été sauvegardées. + controller: + create: + notice: La transaction a été sauvegardée. + create_collection: + alert: ! 'Une erreur s''est produite: %{error}' + error_note_required: + notice: Les transactions ont été sauvegardées. index: balance: ! 'Solde: %{balance}' last_updated_at: (dernière mise à jour il y a %{when}) diff --git a/config/locales/nl.yml b/config/locales/nl.yml index abf19a21..221d9373 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -212,6 +212,11 @@ nl: workgroups: members: leden name: naam + application: + controller: + error_authn: Inloggen vereist. + error_denied: Geen toegang. + error_members_only: Deze actie is alleen beschikbaar voor leden van de groep! article_categories: create: notice: Categorie is opgeslagen @@ -645,11 +650,13 @@ nl: create: notice: Rekening is gemaakt financial_transactions: - create: - notice: De transactie is opgeslagen. - create_collection: - alert: - notice: Alle transacties zijn opgeslagen. + controller: + create: + notice: De transactie is opgeslagen. + create_collection: + alert: + error_note_required: Notitie ontbreekt. + notice: Alle transacties zijn opgeslagen. index: balance: ! 'Tegoed: %{balance}' last_updated_at: (laatst bijgewerkt %{when} geleden) @@ -668,8 +675,8 @@ nl: sidebar: title: ordergroup: - remove: - remove_group: + remove: Verwijderen + remove_group: Huishouden verwijderen transactions: amount: Bedrag date: Datum @@ -856,7 +863,7 @@ nl: title: Lopende bestellingen update: error_general: - error_stale: + error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon je bestelling niet opgeslagen worden. Sorry! notice: De bestelling is opgeslagen. helpers: application: @@ -890,19 +897,19 @@ nl: home: apple_bar: desc: - more_info: + more_info: Meer informatie points: warning: changes_saved: Wijzigingen opgeslagen. index: - due_date_format: + due_date_format: ! '%A %d %B' messages: title: view_all: my_ordergroup: - funds: - last_update: - title: + funds: ! '| Beschikbaar tegoed:' + last_update: Laatst gewijzigd %{when} geleden + title: Mijn huishouden transactions: amount: Bedrag note: Notitie @@ -913,13 +920,13 @@ nl: ordergroup: title: tasks_move: - action: - desc: - title: + action: Taken op je nemen/annuleren + desc: Je bent voor de volgende taken verantwoordelijk. + title: Taken op je nemen tasks_open: - action: - desc: - title: + action: open taken + desc: Er zijn %{size} + title: open taken title: Beginpagina your_tasks: Jouw taken no_ordergroups: Jammergenoeg ben je niet aangesloten bij een huishouden. @@ -946,7 +953,7 @@ nl: admin: finances: accounts: Tegoeden bijwerken - settle: + settle: Bestelling afrekenen title: Financiën foodcoop: Foodcoop members: Leden @@ -1051,13 +1058,31 @@ nl: Vriendelijke groet van %{foodcoop}.' reset_password: - subject: - text: + subject: Nieuw wachtwoord voor %{username} + text: ! 'Beste %{user}, + + + Jij (of iemand anders) heeft een nieuw wachtwoord aangevraagd voor het foodcoop ordersysteem. + + Ga naar de volgende pagina om een nieuw wachtwoord in te voeren: %{link} + + Dit kan slechts éenmaal gedaan worden, en op zijn laatst op %{expires}. + + Wanneer je je wachtwoord niet wilt veranderen, hoef je niets te doen; dan blijft je huidige wachtwoord geldig. + + + Groeten van je foodcoop!' upcoming_tasks: - nextweek: - subject: - text0: - text1: + nextweek: ! 'Taken voor komende week:' + subject: Er is een taak te doen! + text0: ! 'Beste %{user}, + + + Je bent opgegeven voor "%{task}". Deze taak is morgen te vervullen (%{when})!' + text1: ! 'Mijn taken: %{user_tasks_url} + + + Groeten van %{foodcoop}.' messages: create: notice: Bericht is opgeslagen en wordt verzonden.