Sha256: 54e6bf7c66310474756fc8776f7ba007e9ae58c3a150e1f030affaa73f6f5387

Contents?: true

Size: 412 Bytes

Versions: 2

Compression:

Stored size: 412 Bytes

Contents

module AwesomeTranslations::ApplicationHelper
  def helper_t(key, args = {})
    AwesomeTranslations::GlobalTranslator.translate(key, helper: true, caller_number: 1, translation_args: [args])
  end

  def path_without_root(path)
    path.gsub(/\A#{Regexp.escape(Rails.root.to_s)}(\/|)/, "")
  end

  def path_without_root_or_locales(path)
    path_without_root(path).gsub(/\Aconfig\/locales(\/|)/, "")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awesome_translations-0.0.26 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.25 app/helpers/awesome_translations/application_helper.rb