From 135e938d3d4a4c8aaf5eea4c13f611631802c9ef Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 23 Nov 2013 12:05:29 +0100 Subject: [PATCH] i18n cleanups (affects #137) --- .../_transactions.html.haml | 8 ++-- .../new_collection.html.haml | 6 +-- app/views/home/index.html.haml | 8 ++-- app/views/home/ordergroup.html.haml | 4 +- app/views/orders/_articles.html.haml | 4 +- app/views/orders/_form.html.haml | 10 ++--- app/views/orders/_orders.html.haml | 8 ++-- app/views/orders/index.html.haml | 6 +-- app/views/orders/show.html.haml | 10 ++--- config/locales/en.yml | 40 +++++-------------- 10 files changed, 41 insertions(+), 63 deletions(-) diff --git a/app/views/finance/financial_transactions/_transactions.html.haml b/app/views/finance/financial_transactions/_transactions.html.haml index 64b1c938..1dfbc2cb 100644 --- a/app/views/finance/financial_transactions/_transactions.html.haml +++ b/app/views/finance/financial_transactions/_transactions.html.haml @@ -4,10 +4,10 @@ %table.table.table-striped %thead %tr - %td= sort_link_helper t('.date'), "date" - %td= t('.who') - %td= sort_link_helper t('.note'), "note" - %td= sort_link_helper t('.amount'), "amount" + %th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date" + %th= heading_helper FinancialTransaction, :user + %th= sort_link_helper heading_helper(FinancialTransaction, :note), "note" + %th= sort_link_helper heading_helper(FinancialTransaction, :amount), "amount" %tbody - @financial_transactions.each do |t| %tr diff --git a/app/views/finance/financial_transactions/new_collection.html.haml b/app/views/finance/financial_transactions/new_collection.html.haml index aaa67129..7fdc99b0 100644 --- a/app/views/finance/financial_transactions/new_collection.html.haml +++ b/app/views/finance/financial_transactions/new_collection.html.haml @@ -21,13 +21,13 @@ = form_tag finance_create_transaction_collection_path do %p - %b= t('.note') + %b= heading_helper FinancialTransaction, :note = text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required' %p %table#ordergroups{:style => "width:20em"} %tr - %th= t('.ordergroup') - %th= t('.amount') + %th= heading_helper FinancialTransaction, :ordergroup + %th= heading_helper FinancialTransaction, :amount = render :partial => 'ordergroup', :collection => [1, 2, 3] %p = link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn' diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 236d5c5c..41c03e76 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -50,10 +50,10 @@ %h3= t '.my_ordergroup.transactions.title' %table.table.table-striped %tr - %th= t '.my_ordergroup.transactions.when' - %th= t '.my_ordergroup.transactions.where' - %th= t '.my_ordergroup.transactions.note' - %th= t '.my_ordergroup.transactions.amount' + %th= heading_helper FinancialTransaction, :created_on + %th= heading_helper FinancialTransaction, :user + %th= heading_helper FinancialTransaction, :note + %th= heading_helper FinancialTransaction, :amount - for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC') %tr %td= format_time(ft.created_on) diff --git a/app/views/home/ordergroup.html.haml b/app/views/home/ordergroup.html.haml index 213ef0c9..52eb6a18 100644 --- a/app/views/home/ordergroup.html.haml +++ b/app/views/home/ordergroup.html.haml @@ -7,10 +7,10 @@ - unless @ordergroup.description.blank? %p= @ordergroup.description %p - %b= Ordergroup.human_attribute_name(:available_funds) + ':' + %b= heading_helper(Ordergroup, :available_funds) + ':' = number_to_currency(@ordergroup.get_available_funds()) %p - %b= Ordergroup.human_attribute_name(:user_tokens) + ':' + %b= heading_helper(Ordergroup, :user_tokens) + ':' = @ordergroup.memberships.map{|m| show_user m.user}.join(', ') = link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary' .span8 diff --git a/app/views/orders/_articles.html.haml b/app/views/orders/_articles.html.haml index 8508e6e8..b0c54837 100644 --- a/app/views/orders/_articles.html.haml +++ b/app/views/orders/_articles.html.haml @@ -1,8 +1,8 @@ %table.table.table-hover %thead %tr - %th= t '.name' - %th= t '.unit_quantity' + %th= heading_helper Article, :name + %th= heading_helper Article, :unit_quantity %th= t '.prices' %th= t '.units_ordered' - unless order.stockit? diff --git a/app/views/orders/_form.html.haml b/app/views/orders/_form.html.haml index 86d24106..48d776e1 100644 --- a/app/views/orders/_form.html.haml +++ b/app/views/orders/_form.html.haml @@ -11,14 +11,14 @@ %table.table.table-hover#articleList %tr %th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' } - %th= t '.name' - %th= t '.note' + %th= heading_helper Article, :name + %th= heading_helper Article, :note - if @order.stockit? %th= t '.stockit' - else - %th= t '.origin' - %th= t '.supplier' - %th= t '.unit_quantity' + %th= heading_helper Article, :origin + %th= heading_helper Article, :manufacturer + %th= heading_helper Article, :unit_quantity %th= t '.prices' - for category_name, articles in @order.articles_for_ordering %tr.article-category diff --git a/app/views/orders/_orders.html.haml b/app/views/orders/_orders.html.haml index baa5b815..36581491 100644 --- a/app/views/orders/_orders.html.haml +++ b/app/views/orders/_orders.html.haml @@ -2,10 +2,10 @@ %table.table.table-striped %thead %tr - %th= sort_link_helper t('.supplier'), "supplier" - %th= t '.start' - %th= sort_link_helper t('.ending'), "ends" - %th= t '.status' + %th= sort_link_helper heading_helper(Order, :supplier), "supplier" + %th= heading_helper Order, :starts + %th= sort_link_helper heading_helper(Order, :ends), "ends" + %th= heading_helper Order, :status %th{:colspan => "2"} %tbody - @orders.each do |order| diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml index 7960b07f..34b428af 100644 --- a/app/views/orders/index.html.haml +++ b/app/views/orders/index.html.haml @@ -15,9 +15,9 @@ %table.table.table-striped %thead %tr - %th= t '.supplier' - %th= t '.ending' - %th= t '.note' + %th= heading_helper Order, :name + %th= heading_helper Order, :ends + %th= heading_helper Order, :note %th{colspan: "2"} %tbody - for order in @open_orders diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index 865a83c8..075706fe 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -7,16 +7,16 @@ // Order summary .well %dl.dl-horizontal - %dt= t '.supplier' + %dt= heading_helper(Order, :name) + ':' %dd= @order.name - if @note.present? - %dt= t '.note' + %dt= heading_helper(Order, :note) + ':' %dd= @order.note - %dt= t '.created_by' + %dt= heading_helper(Order, :created_by) + ':' %dd= show_user_link(@order.created_by) - %dt= t '.begin' + %dt= heading_helper(Order, :starts) + ':' %dd= format_time(@order.starts) - %dt= t '.ending' + %dt= heading_helper(Order, :ends) + ':' %dd= format_time(@order.ends) %dt= t '.group_orders' %dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')}) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5d3b1e06..567f4a9a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,8 +30,11 @@ en: note: Note supplier: Supplier financial_transaction: - amount: amount - note: note + amount: Amount + created_on: Date + note: Note + ordergroup: Ordergroup + user: Entered by group_order_article: ordergroup_id: Ordergroup result: Amount @@ -54,9 +57,12 @@ en: sent_to_all: Send to all members subject: Subject order: + created_by: Created by ends: Ends at + name: Supplier note: Note starts: Starts at + status: Status order_article: units_to_order: Amount of units update_current_price: Globally update current price @@ -592,21 +598,13 @@ en: paragraph: Here you can credit and debit money for the order group %{name}. title: New transaction new_collection: - amount: Amount new_ordergroup: Add new order group - note: Note - ordergroup: Order group save: Save transaction - sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement + sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement. title: Updating more accounts ordergroup: remove: Remove remove_group: Remove group - transactions: - amount: Amount - date: Date - note: Note - who: Who group_order_articles: form: amount_change_for: Change amount for %{article} @@ -1159,10 +1157,8 @@ en: orders: articles: article_count: ! 'Ordered articles:' - name: Name prices: Net/gross price prices_sum: ! 'Sum (net/gross price):' - unit_quantity: Unit quantity units_full: Full units units_ordered: Units ordered create: @@ -1181,26 +1177,18 @@ en: notice: The order has been closed. form: ignore_warnings: Ignore warnings - name: Name - note: Note - origin: Origin prices: Prices (net/FC) select_all: Select all stockit: In stock - supplier: Producer title: Article - unit_quantity: Unit quantity index: action_end: Close confirm_delete: Do you really want to delete the order? confirm_end: Do you really want to close the order %{order}? There is no going back. ended_orders: Closed orders - ending: End new_order: Create new order no_open_orders: There are currently no open orders. - note: Note open_orders: Current orders - supplier: Supplier title: Manage orders model: error_closed: Order was already settled @@ -1212,17 +1200,11 @@ en: warning_ordered_stock: ! 'Warning: Articles marked red have already been ordered/ purchased within this open stock order. If you uncheck them here, all existing orders/ purchases of these articles will be deleted and it will not be accounted for them.' new: title: Create new order - orders: - ending: End - start: Start - status: Status - supplier: Supplier show: action_end: Close! amounts: ! 'Net/gross sum:' articles: Article overview articles_ordered: ! 'Ordered articles:' - begin: ! 'Begin:' comments: title: Comments comments_link: Comments @@ -1230,7 +1212,6 @@ en: confirm_end: ! 'Do you really want to close the order %{order}? There is no going back.' - created_by: ! 'Created by:' download: article_pdf: Article PDF download_file: Download file @@ -1239,12 +1220,9 @@ en: group_pdf: Group PDF matrix_pdf: Matrix PDF title: Download - ending: ! 'End:' group_orders: ! 'Group orders:' - note: ! 'Note:' sort_article: Sorted in articles sort_group: Sorted in groups - supplier: ! 'Supplier:' title: ! 'Order: %{name}' warn_not_closed: Warning, order is not yet settled. state: