groteck/lita-snap-ci

View on GitHub
lib/snap_ci/translations.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'i18n'

module SnapCi
  module Translations
    module ClassMethods
      def t(key, hash = {})
        I18n.t("lita.handlers.snap_ci.#{key}", hash)
      end
    end

    module InstanceMethods
      private

      def t(key, hash = {})
        self.class.t(key, hash)
      end
    end

    def self.included(receiver)
      receiver.extend         ClassMethods
      receiver.send :include, InstanceMethods
    end
  end
end