Sha256: ad8c32857b0381c697e1b474ad8387654967a0dab4fec05bfc28646fe3194436

Contents?: true

Size: 710 Bytes

Versions: 1

Compression:

Stored size: 710 Bytes

Contents

# encoding: utf-8

module Loaf
  module Translation
    extend self

    # Returns translation lookup
    def i18n_scope
      :breadcrumbs
    end

    # Translate breadcrumb title
    #
    # @param [String] :title
    # @param [Hash] options
    # @option options [String] :scope
    #   The translation scope
    # @option options [String] :default
    #   The default translation
    #
    # @api public
    def breadcrumb_title(title, options = {})
      defaults  = []
      defaults << :"#{i18n_scope}.#{title}"
      defaults << options.delete(:default) if options[:default]

      options.reverse_merge! count: 1, default: defaults
      I18n.t(title, options)
    end
  end # Translation
end # Loaf

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loaf-0.4.0 lib/loaf/translation.rb