Class: CodelessCode::Commands::ListTranslations

Inherits:
Object
  • Object
show all
Defined in:
lib/codeless_code/commands/list_translations.rb

Instance Method Summary collapse

Constructor Details

#initialize(io: nil) ⇒ ListTranslations

Returns a new instance of ListTranslations.

Parameters:

  • io (IO) (defaults to: nil)

    if given, the output will be written to this stream, otherwise STDOUT will be used



21
22
23
# File 'lib/codeless_code/commands/list_translations.rb', line 21

def initialize(io: nil)
  @io = io
end

Instance Method Details

#callObject



25
26
27
28
29
30
# File 'lib/codeless_code/commands/list_translations.rb', line 25

def call
  Catalog.new.language_sets.each do |set|
    translators = set.fable_sets.map(&:translator).sort
    puts format('%s  %s', set.lang, translators.join(', '))
  end
end