Sha256: 1ee5b87a759e70885c80c75517c7df6fcf6a954fdeb2012dc98b183df0eea264

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "optparse"
require "habluhablu"

args = {}
OptionParser.new do |opts|
  opts.banner = "Generate files including basic phrases translations (using with I18n gem)"

  opts.on("-l", "--language SYMBOL", "Symbol of the language you want to generate file for (en, es, ...).")
  opts.on("-m", "--multi SYMBOLS", "Symbols of languages you want to generate files for (en es pl ar)")
end.parse!(into: args)

if args[:multi].nil?
  Habluhablu.hablu(args[:language])
  if File.exist?("config/locales/#{args[:language]}.yml")
    puts "..."
    sleep 0.5
    puts "Everything was generated successfully!"
  else
    puts "Something went wrong!"
  end
else
  languages_array = args[:multi].split("_")
  languages_array.each do |language|
    Habluhablu.hablu(language)
  end
  if File.exist?("config/locales/#{languages_array.last}.yml")
    puts "..."
    sleep 0.5
    puts "Everything was generated successfully!"
  else
    puts "Something went wrong!"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
habluhablu-0.2.3 exe/habluhablu