aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-10-29 10:51:56 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-10-29 10:51:56 +0100
commit4dbfe18b37ad4fa95eecb9082a446c798e84e499 (patch)
tree885701c845a0e3589f1b565f0ee610faf792e447 /activesupport
parent4ad5aa9a39a83863331a7665407dac475855765b (diff)
downloadrails-4dbfe18b37ad4fa95eecb9082a446c798e84e499.tar.gz
rails-4dbfe18b37ad4fa95eecb9082a446c798e84e499.tar.bz2
rails-4dbfe18b37ad4fa95eecb9082a446c798e84e499.zip
Proper API for reloading translations
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG2
-rwxr-xr-xactivesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb7
-rw-r--r--activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb3
3 files changed, 10 insertions, 2 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 903c7b6e76..24a7f1639e 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,6 +1,6 @@
*2.2.1 [RC2 or 2.2 final]*
-* Make I18n::Backend::Simple reload its translations in development mode [DHH]
+* Make I18n::Backend::Simple reload its translations in development mode [DHH/Sven Fuchs]
*2.2.0 [RC1] (October 24th, 2008)*
diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
index 9b0b69f58b..40e82d8225 100755
--- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
@@ -67,6 +67,13 @@ module I18n
def load_path=(load_path)
@@load_path = load_path
end
+
+ # Tells the backend to reload translations. Used in situations like the
+ # Rails development environment. Backends can implement whatever strategy
+ # is useful.
+ def reload!
+ backend.reload!
+ end
# Translates, pluralizes and interpolates a given key using a given locale,
# scope, and default, as well as interpolation values.
diff --git a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
index c682eadf85..bdda55d3fe 100644
--- a/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
+++ b/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
@@ -69,8 +69,9 @@ module I18n
@initialized ||= false
end
- def reload
+ def reload!
@initialized = false
+ @translations = nil
end
protected