Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed bug that caused stringified object name to reject the localize …

…method

because it is not a symbol.

Now the object name is cast into a symbol before being localized.
  • Loading branch information...
commit 36f07a990f4c4d559f33cacd5c151c326ca698be 1 parent bfc1c2a
Mert Torun edgerunner authored

Showing 2 changed files with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  lang/rails/tr.yml
  2. +1 1  lib/rails/localized_action_view.rb
2  lang/rails/tr.yml
@@ -63,7 +63,7 @@ array_skip_last_comma: 'false'
63 63
64 64 # Active Record error messages:
65 65 active_record_helper_error_description: 'Aşağıdaki alanlarla ilgili sorunlar oluştu:'
66   -active_record_helper_header_message: "{error_count} hata bulundu"
  66 +active_record_helper_header_message: "{error_count} hata yüzünden {failed_object} kaydedilemedi"
67 67
68 68 date_helper_month_names:
69 69 - # Leave that line
2  lib/rails/localized_action_view.rb
@@ -183,7 +183,7 @@ def error_messages_for(*params)
183 183 options[:object_name] ||= params.first
184 184
185 185 original_failed_object = options[:object_name].to_s.gsub('_', ' ')
186   - failed_object = options[:object_name].l(original_failed_object)
  186 + failed_object = options[:object_name].to_sym.l(original_failed_object)
187 187
188 188 original_header_message = "#{pluralize(count, 'error')} prohibited this #{original_failed_object} from being saved"
189 189 header_message = :active_record_helper_header_message.l_with_args({:error_count => count, :failed_object => failed_object }, original_header_message)

0 comments on commit 36f07a9

Please sign in to comment.
Something went wrong with that request. Please try again.