Autoload I18n simple backend
This commit is contained in:
parent
f40eb52566
commit
4f63e84843
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user