Commit d1bd2143 authored by gwendal's avatar gwendal
Browse files

fix locales

parent 289eadea
......@@ -16,7 +16,7 @@ class ServiceSalesController < InvoicingLineItemsController
def ensure_ledger_is_not_subscription
@service_sale.ledger_item_id ||= params[:ledger_item_id] || params[:member_invoice_id] || params[:member_payment_id] || params[:member_credit_note_id]
if @service_sale.ledger_item.subscription?
flash[:error] = I18n.t("activerecord.errors.models.invoicing_line_item.messages.service_can_not_be_add_to_subscription_ledger_item")
flash[:error] = I18n.t("activerecord.errors.models.invoicing_line_item.service_can_not_be_add_to_subscription_ledger_item")
redirect_to @service_sale.ledger_item
end
end
......
......@@ -15,7 +15,7 @@ class SubscriptionSalesController < InvoicingLineItemsController
def ensure_ledger_is_subscription
@subscription_sale .ledger_item_id ||= params[:ledger_item_id] || params[:member_invoice_id] || params[:member_payment_id]
if not @subscription_sale.ledger_item.subscription?
flash[:error] = I18n.t("activerecord.errors.models.invoicing_line_item.messages.subscription_should_be_same_as_ledger_item")
flash[:error] = I18n.t("activerecord.errors.models.invoicing_line_item.subscription_should_be_same_as_ledger_item")
redirect_to @subscription_sale.ledger_item
end
end
......
......@@ -9,7 +9,7 @@ class TreasurerMailer < ActionMailer::Base
@crew = crew
mail(
to: to,
subject: subject(t(:subject, scope: [:treasureur_mailer, :subscription_payment]) % {number: @member.number})
subject: subject(t('.subject') % {number: @member.number})
) do |format|
format.text
format.html
......@@ -28,7 +28,7 @@ class TreasurerMailer < ActionMailer::Base
# @renewal_method_changed = renewal_method_changed
mail(
to: to,
subject: subject(t(:subject, scope: [:treasureur_mailer, :service_payment]) % {number: @member.number, login: @service.login })
subject: subject(t('.subject') % {number: @member.number, login: @service.login })
) do |format|
format.text
format.html
......
......@@ -20,7 +20,7 @@
<%= button_to t('.resend_email_confirmation'), send_email_confirmation_path %>
</p>
<% end %>
<div><%= t('activerecord.attributes..member.address')%>: <pre>
<div><%= Member.human_attribute_name('address')%> : <pre>
<%= best_in_place @member, :address %>
<%= best_in_place @member, :zipcode %>
<%= best_in_place @member, :city %>
......
......@@ -7,9 +7,9 @@ class ScanActiveRecordsErrors < I18n::Tasks::Scanners::FileScanner
text = read_file(path)
text.scan(/^\s*errors.add(?:\():([\w]*), (?:I18n.t\(){0,1}(?::){0,1}(?:"){0,1}([^"\r\n\),]*)/).map do |type, message|
if type == "base"
attribute_or_message = "messages"
attribute_or_message = ""
else
attribute_or_message = "attributes.#{type}"
attribute_or_message = ".attributes.#{type}"
end
occurrence = occurrence_from_position(
path, text, Regexp.last_match.offset(0).first)
......@@ -19,7 +19,7 @@ class ScanActiveRecordsErrors < I18n::Tasks::Scanners::FileScanner
# p message
# p ["activerecord.errors.models.%s.%s.%s" % [model, attribute_or_message, message], occurrence]
# p "================"
["activerecord.errors.models.%s.%s.%s" % [model, attribute_or_message, message], occurrence]
["activerecord.errors.models.%s%s.%s" % [model, attribute_or_message, message], occurrence]
end
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment