From 569cdce2dbd8e21a57aa6bb58b49ffc35fc72bb5 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 22 Feb 2013 00:44:39 +0100 Subject: [PATCH] finish finance controller i18n --- app/controllers/finance/invoices_controller.rb | 4 ++-- config/locales/de/de.finance.yml | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/finance/invoices_controller.rb b/app/controllers/finance/invoices_controller.rb index 60459e06..37cf839f 100644 --- a/app/controllers/finance/invoices_controller.rb +++ b/app/controllers/finance/invoices_controller.rb @@ -22,7 +22,7 @@ class Finance::InvoicesController < ApplicationController @invoice = Invoice.new(params[:invoice]) if @invoice.save - flash[:notice] = "Rechnung wurde erstellt." + flash[:notice] = I18n.t('finance.create.notice') if @invoice.order # Redirect to balancing page redirect_to new_finance_order_url(order_id: @invoice.order.id) @@ -38,7 +38,7 @@ class Finance::InvoicesController < ApplicationController @invoice = Invoice.find(params[:id]) if @invoice.update_attributes(params[:invoice]) - redirect_to [:finance, @invoice], notice: "Rechnung wurde aktualisiert." + redirect_to [:finance, @invoice], notice: I18n.t('finance.update.notice') else render :edit end diff --git a/config/locales/de/de.finance.yml b/config/locales/de/de.finance.yml index 67dc41bb..e5748577 100644 --- a/config/locales/de/de.finance.yml +++ b/config/locales/de/de.finance.yml @@ -144,4 +144,9 @@ de: title: "Konten verwalten" new_transaction: "Neue Überweisungen eingeben" search_placeholder: 'Suchen ...' - \ No newline at end of file + + # used by controller + create: + notice: 'Rechnung wurde erstellt.' + update: + notice: 'Rechnung wurde aktualisiert.'