instance method load_file

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.2.3

Signature

load_file(filename)

Loads a single translations file by delegating to #load_rb or #load_yml depending on the file extension and directly merges the data to the existing translations. Raises I18n::UnknownFileType for all other file extensions.

Parameters

filename req
Source
# File activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb, line 175
        def load_file(filename)
          type = File.extname(filename).tr('.', '').downcase
          raise UnknownFileType.new(type, filename) unless respond_to?(:"load_#{type}")
          data = send :"load_#{type}", filename # TODO raise a meaningful exception if this does not yield a Hash
          data.each { |locale, d| merge_translations(locale, d) }
        end

Defined in activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb line 175 · View on GitHub · Improve this page · Find usages on GitHub

Defined in I18n::Backend::Simple

Type at least 2 characters to search.

↑↓ navigate · open · esc close