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.16.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.15.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.14.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.13.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.13.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.12.2 app/components/coco/concerns/translatable.rb
coveragebook_components-0.12.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.12.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.11.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/concerns/translatable.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.10.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.9.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.9.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.8.9 app/components/coco/concerns/translatable.rb
coveragebook_components-0.8.8 app/components/coco/concerns/translatable.rb
coveragebook_components-0.8.7 app/components/coco/concerns/translatable.rb
coveragebook_components-0.8.6 app/components/coco/concerns/translatable.rb
coveragebook_components-0.8.5 app/components/coco/concerns/translatable.rb