Class: Maglev::ExtractLocale

Inherits:
Object
  • Object
show all
Includes:
Injectable
Defined in:
app/services/maglev/extract_locale.rb

Overview

Extract the locale from the current HTTP request and set the Translatable.current_locale accordingly

Instance Method Summary collapse

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
# File 'app/services/maglev/extract_locale.rb', line 12

def call
  locale, path = extract_locale

  Maglev::I18n.current_locale = locale

  params[:path] = path

  [path, locale]
end