Class: Api::V1::Google::BaseController

Inherits:
ActionController::Metal
  • Object
show all
Includes:
AbstractController::Rendering, ActionController::Redirecting, ActionController::Renderers::All
Defined in:
app/controllers/api/v1/google/base_controller.rb

Overview

Controller: base.

Direct Known Subclasses

ProductsController, ReviewsController

Instance Method Summary collapse

Instance Method Details

#get_localeObject



8
9
10
11
12
13
14
# File 'app/controllers/api/v1/google/base_controller.rb', line 8

def get_locale
  I18n.available_locales
  request_locale = params[:locale]&.to_sym
  request_locale = nil unless I18n.available_locales.include?(request_locale)
  CurrentScope.locale = request_locale if request_locale
  request_locale
end