Sha256: c136ffdd5bfbec182b0356511cf896802840dd378c8280ba6171f58c0283afe7

Contents?: true

Size: 692 Bytes

Versions: 22

Compression:

Stored size: 692 Bytes

Contents

module Localeapp
  module CLI
    class Add < Command
      def execute(key, *translations)
        @output.puts "Localeapp Add"
        @output.puts ""
        translations.each do |translation|
          if translation =~ /([\w\-]+):(.*)/
            locale, description = $1, $2
            Localeapp.missing_translations.add(locale, key, description)
          else
            @output.puts "Ignoring bad translation #{translation}"
            @output.puts "format should be <locale>:<translation content>"
          end
        end
        @output.puts "Sending key: #{key}"
        Localeapp.sender.post_missing_translations
        @output.puts "Success!"
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
localeapp-0.9.2 lib/localeapp/cli/add.rb
localeapp-0.9.1 lib/localeapp/cli/add.rb
localeapp-0.9.0 lib/localeapp/cli/add.rb
localeapp-0.8.1 lib/localeapp/cli/add.rb
localeapp-0.8.0 lib/localeapp/cli/add.rb
localeapp-0.7.2 lib/localeapp/cli/add.rb
localeapp-0.7.1 lib/localeapp/cli/add.rb
localeapp-0.7.0 lib/localeapp/cli/add.rb
localeapp-0.6.14 lib/localeapp/cli/add.rb
localeapp-0.6.13 lib/localeapp/cli/add.rb
localeapp-0.6.12 lib/localeapp/cli/add.rb
localeapp-0.6.10 lib/localeapp/cli/add.rb
localeapp-0.6.9 lib/localeapp/cli/add.rb
localeapp-0.6.8 lib/localeapp/cli/add.rb
localeapp-0.6.7 lib/localeapp/cli/add.rb
localeapp-0.6.6 lib/localeapp/cli/add.rb
localeapp-0.6.5 lib/localeapp/cli/add.rb
localeapp-0.6.4 lib/localeapp/cli/add.rb
localeapp-0.6.3 lib/localeapp/cli/add.rb
localeapp-0.6.2 lib/localeapp/cli/add.rb