Sha256: 0313ec695126dc58f219b1cc8de952b8874b35f38d8fb465df3ed06e406dc791

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

module RailsAssetLocalization
  class LocalesController < ::ApplicationController
    respond_to :json

    def locale
      locale = params.fetch(:locale) { I18n.default_locale.to_s }
      locale = $1 if locale =~ /(\w+)\-(\w+)/

      locales_exporter = ::RailsAssetLocalization::LocalesExporter.new
      respond_with (locales_exporter.translations[locale.to_sym] || {}).to_json
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-asset-localization-0.1.0 app/controllers/rails_asset_localization/locales_controller.rb