Sha256: ce5abaa7fbc3de7f689d3e1b43ea99e0f5aeb654a0c5192ba97e838003441a03
Contents?: true
Size: 960 Bytes
Versions: 9
Compression:
Stored size: 960 Bytes
Contents
require "i18n" require "pact_broker/api/pact_broker_urls" I18n.config.load_path << File.expand_path("../locale/en.yml", __FILE__) module PactBroker # Provides an interface to the I18n library specifically for # the PactBroker's messages. module Messages extend self # Interpolates an internationalized string. # @param [String] key the name of the string to interpolate # @param [Hash] options options to pass to I18n, including # variables to interpolate. # @return [String] the interpolated string def message(key, options={}) ::I18n.t(key, { :scope => :pact_broker }.merge(options)) end def validation_message key, options = {} message("errors.validation." + key, options) end def pluralize(word, count) if count == 1 word else if word.end_with?("y") word.chomp("y") + "ies" else word + "s" end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems