Sha256: 84b5e601652c4194548cb193f5220734c4231fc95970aca19d2fd0acf3b7a617
Contents?: true
Size: 835 Bytes
Versions: 20
Compression:
Stored size: 835 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 t translate def context Spree::ViewContext.context end def virtual_path if context path = context.instance_variable_get('@virtual_path') path.gsub(/spree/, '') if path end end end end
Version data entries
20 entries across 20 versions & 1 rubygems