Sha256: 0acff68c00225da6934cb8a4698bfef002e20e573f83a2f3035cc39385968552

Contents?: true

Size: 691 Bytes

Versions: 1

Compression:

Stored size: 691 Bytes

Contents

# encoding: utf-8

module Loaf
  module Translation
    extend self

    # Returns translation lookup
    def translation_scope
      "loaf.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 find_title(title, options = {})
      options[:scope] ||= translation_scope
      options[:default] = Array(options[:default])
      options[:default] << title if options[:default].empty?
      I18n.t("#{title}", options)
    end
  end # Translation
end # Loaf

Version data entries

1 entries across 1 versions & 1 rubygems

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