Class: MiradorRails::LocalesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/mirador_rails/locales_controller.rb

Instance Method Summary collapse

Instance Method Details

#localeObject



4
5
6
7
8
9
10
# File 'app/controllers/mirador_rails/locales_controller.rb', line 4

def locale
  language = params.fetch(:id) { I18n.default_locale.to_s }
  locale = MiradorRails::Locale.new(language)
  render json: locale.file_source
rescue MiradorRails::Exceptions::LocaleNotFound
  raise ActionController::RoutingError.new('Not Found')
end