mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Bring i18n code from spree
This commit is contained in:
17
lib/spree/i18n/base.rb
Normal file
17
lib/spree/i18n/base.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module Spree
|
||||
module ViewContext
|
||||
def self.context=(context)
|
||||
@context = context
|
||||
end
|
||||
|
||||
def self.context
|
||||
@context
|
||||
end
|
||||
|
||||
def view_context
|
||||
super.tap do |context|
|
||||
Spree::ViewContext.context = context
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
1
lib/spree/i18n/initializer.rb
Normal file
1
lib/spree/i18n/initializer.rb
Normal file
@@ -0,0 +1 @@
|
||||
Spree::BaseController.send(:include, Spree::ViewContext)
|
||||
Reference in New Issue
Block a user