Sha256: 71ef98d2cdd37726b455f1000f49a3b986b6dfbfe09af900261e55c795263116

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

module RailsAssetLocalization
  class LocalesExporter
    def initialize
      I18n.backend.send(:init_translations)
    end

    def translations
      return @translations ||= HashWithIndifferentAccess.new(extract_translations)
    end

    private
    def extract_translations
      if defined?(CopycopterClient) && I18n.backend.is_a?(CopycopterClient::I18nBackend)
        YAML.load I18n.backend.send(:cache).export
      else
        I18n.backend.send(:translations)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-asset-localization-0.1.0 lib/rails_asset_localization/locales_exporter.rb