aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2013-04-09 21:43:00 -0700
committerSteve Klabnik <steve@steveklabnik.com>2013-04-09 21:43:00 -0700
commitfa3ef8e82ab2f96cf15ef9bc885b2468fad77621 (patch)
tree2919c47057181f372714d6e9a6e36b305e1686c4 /activesupport/lib/active_support
parente0af93dd3a5eeee2e2a67b05f34afb66cc80c00b (diff)
parent8cf88cc75ad0289f39fc2272c372f945b3934e76 (diff)
downloadrails-fa3ef8e82ab2f96cf15ef9bc885b2468fad77621.tar.gz
rails-fa3ef8e82ab2f96cf15ef9bc885b2468fad77621.tar.bz2
rails-fa3ef8e82ab2f96cf15ef9bc885b2468fad77621.zip
Merge pull request #10158 from steveklabnik/issue_10125
Fix inflector to respect default locale.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/string/inflections.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/inflections.rb b/activesupport/lib/active_support/core_ext/string/inflections.rb
index 6522145572..b38fa9125a 100644
--- a/activesupport/lib/active_support/core_ext/string/inflections.rb
+++ b/activesupport/lib/active_support/core_ext/string/inflections.rb
@@ -28,7 +28,7 @@ class String
# 'apple'.pluralize(2) # => "apples"
# 'ley'.pluralize(:es) # => "leyes"
# 'ley'.pluralize(1, :es) # => "ley"
- def pluralize(count = nil, locale = :en)
+ def pluralize(count = nil, locale = I18n.locale)
locale = count if count.is_a?(Symbol)
if count == 1
self
@@ -51,7 +51,7 @@ class String
# 'the blue mailmen'.singularize # => "the blue mailman"
# 'CamelOctopi'.singularize # => "CamelOctopus"
# 'leyes'.singularize(:es) # => "ley"
- def singularize(locale = :en)
+ def singularize(locale = I18n.locale)
ActiveSupport::Inflector.singularize(self, locale)
end