Module: SetupConfiguration::Translation

Defined in:
lib/setup_configuration/translation.rb

Defined Under Namespace

Classes: Translator

Constant Summary collapse

FILE_EXTENSION =
'setup.param'.freeze

Class Method Summary collapse

Class Method Details

.language_abbreviation(lang_name) ⇒ Object



26
27
28
# File 'lib/setup_configuration/translation.rb', line 26

def self.language_abbreviation(lang_name)
  language_defs.invert[lang_name.downcase]
end

.language_name(lang) ⇒ Object



22
23
24
# File 'lib/setup_configuration/translation.rb', line 22

def self.language_name(lang)
  language_defs[lang]
end

.language_namesObject



30
31
32
# File 'lib/setup_configuration/translation.rb', line 30

def self.language_names
  language_defs.values.sort
end

.languagesObject

Returns all supported setup languages.



18
19
20
# File 'lib/setup_configuration/translation.rb', line 18

def self.languages
  language_defs.keys
end

.translation_file(config_name, lang) ⇒ Object



9
10
11
# File 'lib/setup_configuration/translation.rb', line 9

def self.translation_file(config_name, lang)
  "#{config_name}.#{FILE_EXTENSION}.#{lang}.yml"
end

.translation_files(config_name) ⇒ Object



13
14
15
# File 'lib/setup_configuration/translation.rb', line 13

def self.translation_files(config_name)
  languages.collect { |lang| translation_file(config_name, lang) }
end