Sha256: 6436110975d93d35d4b839e8e92727d8a2e954f7f0137446eff0f66f0bc59b93

Contents?: true

Size: 377 Bytes

Versions: 71

Compression:

Stored size: 377 Bytes

Contents

module Coco
  module Concerns
    module Translatable
      extend ActiveSupport::Concern

      def tt(key)
        t("coco.#{self.class.i18n_path}.#{key}")
      end

      class_methods do
        def i18n_path(path = nil)
          @_i18n_path = path unless path.nil?
          @_i18n_path ||= component_path.underscore.tr("/", ".")
        end
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
coveragebook_components-0.6.4 app/components/coco/concerns/translatable.rb
coveragebook_components-0.6.3 app/components/coco/concerns/translatable.rb
coveragebook_components-0.6.2 app/components/coco/concerns/translatable.rb
coveragebook_components-0.6.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.6.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.7 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.6 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.5 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.4 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.3 app/components/coco/concerns/translatable.rb
coveragebook_components-0.5.2 app/components/coco/concerns/translatable.rb