Autoload I18n simple backend

This commit is contained in:
Jeremy Kemper 2009-04-17 22:24:36 -07:00
parent f40eb52566
commit 4f63e84843
3 changed files with 11 additions and 5 deletions

@ -1,3 +1,4 @@
#--
# Authors:: Matt Aimonetti (http://railsontherun.com/),
# Sven Fuchs (http://www.artweb-design.de),
# Joshua Harvey (http://www.workingwithrails.com/person/759-joshua-harvey),
@ -5,10 +6,14 @@
# Stephan Soller (http://www.arkanis-development.de/)
# Copyright:: Copyright (c) 2008 The Ruby i18n Team
# License:: MIT
require 'i18n/backend/simple'
require 'i18n/exceptions'
#++
module I18n
autoload :ArgumentError, 'i18n/exceptions'
module Backend
autoload :Simple, 'i18n/backend/simple'
end
@@backend = nil
@@load_path = nil
@@default_locale = :'en'

@ -1,4 +1,4 @@
require 'yaml'
require 'i18n/exceptions'
module I18n
module Backend
@ -186,6 +186,7 @@ def load_rb(filename)
# Loads a YAML translations file. The data must have locales as
# toplevel keys.
def load_yml(filename)
require 'yaml' unless defined? :YAML
YAML::load(IO.read(filename))
end
@ -211,4 +212,4 @@ def deep_symbolize_keys(hash)
end
end
end
end
end

@ -50,4 +50,4 @@ def initialize(type, filename)
super "can not load translations from #{filename}, the file type #{type} is not known"
end
end
end
end