Sha256: f68c4fea55da34d16730543461951ac3ab182c9093f51967e0b2e91c167c238d
Contents?: true
Size: 867 Bytes
Versions: 133
Compression:
Stored size: 867 Bytes
Contents
require 'i18n' require 'active_support/core_ext/array/extract_options' require 'spree/i18n/base' module Spree extend ActionView::Helpers::TranslationHelper extend ActionView::Helpers::TagHelper class << self # Add spree namespace and delegate to Rails TranslationHelper for some nice # extra functionality. e.g return reasonable strings for missing translations def translate(*args) @virtual_path = virtual_path options = args.extract_options! options[:scope] = [*options[:scope]].unshift(:spree) args << options super(*args) end alias_method :t, :translate def context Spree::ViewContext.context end def virtual_path if context path = context.instance_variable_get("@virtual_path") if path path.gsub(/spree/, '') end end end end end
Version data entries
133 entries across 133 versions & 3 rubygems