diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-09-27 14:04:46 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-09-27 14:04:46 +0100 |
commit | fda846cf5ddf523b00a39c26591489794b5de568 (patch) | |
tree | 00d4860d53e5c861fd9b3f483f04ff0d2db19307 /activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb | |
parent | df046298715b1927a832973c4c29955696fee02c (diff) | |
parent | ea609b265ffc30cac00bf09a262027f96964ed6f (diff) | |
download | rails-fda846cf5ddf523b00a39c26591489794b5de568.tar.gz rails-fda846cf5ddf523b00a39c26591489794b5de568.tar.bz2 rails-fda846cf5ddf523b00a39c26591489794b5de568.zip |
Merge commit 'mainstream/master'
Conflicts:
activerecord/lib/active_record/base.rb
railties/Rakefile
railties/doc/guides/activerecord/association_basics.txt
railties/doc/guides/debugging/debugging_rails_applications.txt
railties/doc/guides/getting_started_with_rails/getting_started_with_rails.txt
railties/doc/guides/index.txt
railties/doc/guides/migrations/foreign_keys.txt
railties/doc/guides/migrations/migrations.txt
railties/doc/guides/migrations/writing_a_migration.txt
railties/doc/guides/routing/routing_outside_in.txt
Diffstat (limited to 'activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb')
-rwxr-xr-x | activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb | 27 |
1 files changed, 17 insertions, 10 deletions
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 0988ea8f44..344c77aecf 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 @@ -10,7 +10,8 @@ require 'i18n/exceptions' module I18n @@backend = nil - @@default_locale = 'en-US' + @@load_path = nil + @@default_locale = :'en-US' @@exception_handler = :default_exception_handler class << self @@ -49,14 +50,22 @@ module I18n @@exception_handler = exception_handler end - # Allows client libraries to pass arguments that specify a source for - # translation data to be loaded by the backend. The backend defines - # acceptable sources. + # Allow clients to register paths providing translation data sources. The + # backend defines acceptable sources. + # # E.g. the provided SimpleBackend accepts a list of paths to translation # files which are either named *.rb and contain plain Ruby Hashes or are - # named *.yml and contain YAML data.) - def load_translations(*args) - backend.load_translations(*args) + # named *.yml and contain YAML data. So for the SimpleBackend clients may + # register translation files like this: + # I18n.load_path << 'path/to/locale/en-US.yml' + def load_path + @@load_path ||= [] + end + + # Sets the load path instance. Custom implementations are expected to + # behave like a Ruby Array. + def load_path=(load_path) + @@load_path = load_path end # Translates, pluralizes and interpolates a given key using a given locale, @@ -175,6 +184,4 @@ module I18n keys.flatten.map{|k| k.to_sym} end end -end - - +end
\ No newline at end of file |