Sha256: 47133ea23c45aa7ebb8d3bc4e85c47625034cc1ce7d8863de5949ccfdf79d355

Contents?: true

Size: 1.45 KB

Versions: 1

Compression:

Stored size: 1.45 KB

Contents

require 'thor'
require 'colorize'

require "icapps/translations/configuration"
require "icapps/translations/import/xcode"

module Icapps
  module Translations
    class CLI < Thor
      desc 'init', 'Prepare the current folder to use iCapps translations.'
      long_desc <<-LONGDESC
      'init' will generate a .translations configuration file at the location where you run the script. You should do this in the project root.

      You will be able to configure the following parameters:
      \x5> the default .strings filename
      \x5> the default base url

      With --verbose option, some extra loggin is shown.
      LONGDESC
      option :verbose, type: :boolean
      def init
        puts "[VERBOSE] Running the 'translations init command'.".colorize(:white) if options[:verbose]
        ::Icapps::Translations.options = options
        ::Icapps::Translations::Configuration.create
      end

      desc 'import', 'Import the translations into your project\'s .string files.'
      long_desc <<-LONGDESC
      'import' will overwrite all the matching .strings files in your project. You should do this in the project root.

      With --verbose option, some extra loggin is shown.
      LONGDESC
      option :verbose, type: :boolean
      def import
        puts "[VERBOSE] Running the 'translations import command'.".colorize(:white) if options[:verbose]
        ::Icapps::Translations.options = options
        ::Icapps::Translations.import
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
icapps-translations-0.2.0 lib/icapps/translations/cli.rb