Class: StiDeploy::Messages

Inherits:
Object
  • Object
show all
Defined in:
lib/sti_deploy/messages.rb

Constant Summary collapse

LANG_PATH =
File.expand_path(File.join(__dir__, '../../', 'lang/', '*.yml'))

Class Method Summary collapse

Class Method Details

.load_messagesObject

Load the translation files and set the configured language



18
19
20
21
22
23
24
# File 'lib/sti_deploy/messages.rb', line 18

def load_messages
  I18n.load_path = Dir[LANG_PATH]
  I18n.backend.load_translations
  I18n.default_locale = :en
  return unless const_defined?('StiDeploy::Configuration')
  I18n.locale = Configuration.language
end


30
31
32
# File 'lib/sti_deploy/messages.rb', line 30

def print(i18n_key, options = {})
  super colorized_message(i18n_key, options)
end

.puts(i18n_key, options = {}) ⇒ Object



26
27
28
# File 'lib/sti_deploy/messages.rb', line 26

def puts(i18n_key, options = {})
  super colorized_message(i18n_key, options)
end