lib/refinery/i18n.rb in refinerycms-i18n-0.9.9.7 vs lib/refinery/i18n.rb in refinerycms-i18n-0.9.9.8
- old
+ new
@@ -63,21 +63,21 @@
config.after_initialize do
::Refinery::I18n.setup! if defined?(RefinerySetting) and RefinerySetting.table_exists?
Refinery::Plugin.register do |plugin|
plugin.name = "refinery_i18n"
- plugin.version = %q{0.9.9.7}
+ plugin.version = %q{0.9.9.8}
plugin.hide_from_menu = true
plugin.always_allow_access = true
end
end
end
class << self
- attr_accessor :enabled, :current_locale, :locales, :default_locale, :default_frontend_locale, :built_in_locales
+ attr_accessor :built_in_locales, :current_locale, :default_locale, :default_frontend_locale, :enabled, :locales
def enabled?
# cache this lookup as it gets very expensive.
if defined?(@enabled) && !@enabled.nil?
@enabled
@@ -162,13 +162,10 @@
@default_locale = nil
@default_frontend_locale = nil
@current_locale = nil
@frontend_locales = nil
- self.load_base_locales!
- self.load_refinery_locales!
- self.load_app_locales!
self.set_default_locale!
self.ensure_locales_up_to_date!
end
def ensure_locales_up_to_date!
@@ -187,31 +184,11 @@
RefinerySetting[:i18n_translation_locales] = value
end
end
end
- def load_base_locales!
- load_locales Pathname.new(__FILE__).parent.join "..", "config", "locales", "*.yml"
- end
-
- def load_refinery_locales!
- load_locales Refinery.root.join "vendor", "engines", "*", "config", "locales", "*.yml"
- end
-
- def load_app_locales!
- load_locales Rails.root.join "config", "locales", "*.yml"
- end
-
def set_default_locale!
::I18n.default_locale = ::Refinery::I18n.default_locale
- end
-
- def load_locales(locale_files)
- locale_files = locale_files.to_s if locale_files.is_a? Pathname
- locale_files = Dir[locale_files] if locale_files.is_a? String
- locale_files.each do |locale_file|
- ::I18n.load_path.unshift locale_file
- end
end
end
@built_in_locales = {