Module: Controllers::ContentLocalizable
- Extended by:
- ActiveSupport::Concern
- Included in:
- CatalogItemsController, ItemsController, ProductLinesController, ProductSpecificationsController
- Defined in:
- app/concerns/controllers/content_localizable.rb
Overview
This concern assists with content/mobility localization vs interface
localization, since this concern is purely CRM, I chosed to separate it
in its own concern for now - CB
This code is largely copied from lokalize example: https://www.youtube.com/watch?v=2Fyg-22iA9I
Instance Method Summary collapse
- #allow_content_locale_switch ⇒ Object
- #default_url_options ⇒ Object
-
#set_content_locale ⇒ Object
This is for UI editing and mobility.
Instance Method Details
#allow_content_locale_switch ⇒ Object
28 29 30 31 |
# File 'app/concerns/controllers/content_localizable.rb', line 28 def allow_content_locale_switch # This variable will determine if we need to show a locale selector in the menu interface of crm @content_localizable = true end |
#default_url_options ⇒ Object
33 34 35 |
# File 'app/concerns/controllers/content_localizable.rb', line 33 def super.merge(content_locale: Mobility.locale) end |
#set_content_locale ⇒ Object
This is for UI editing and mobility
23 24 25 26 |
# File 'app/concerns/controllers/content_localizable.rb', line 23 def set_content_locale @content_locale = extract_locale(:content_locale) || I18n.default_locale Mobility.locale = @content_locale end |