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.19.8 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.7 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.6 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.5 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.4 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.3 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.2 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.19.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.18.8 app/components/coco/concerns/translatable.rb
coveragebook_components-0.18.7 app/components/coco/concerns/translatable.rb
coveragebook_components-0.18.0 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.7 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.6 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.5 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.4 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.3 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.2 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.1 app/components/coco/concerns/translatable.rb
coveragebook_components-0.17.0 app/components/coco/concerns/translatable.rb