Class: Jekyll::Task::I18n

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/jekyll/task/i18n.rb,
lib/jekyll/task/i18n/version.rb

Defined Under Namespace

Classes: Path

Constant Summary collapse

VERSION =
"1.1.0"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeI18n

Returns a new instance of I18n.



42
43
44
45
46
47
48
49
50
51
# File 'lib/jekyll/task/i18n.rb', line 42

def initialize
  @po_dir_path = Pathname.new("_po")
  @base_dir_path = Pathname.new(".")
  @locales = []
  @files = []
  @translator_name = nil
  @translator_email = nil
  @yard_locales = {}
  @custom_translator = nil
end

Instance Attribute Details

#custom_translatorObject

Returns the value of attribute custom_translator.



41
42
43
# File 'lib/jekyll/task/i18n.rb', line 41

def custom_translator
  @custom_translator
end

#filesObject

Returns the value of attribute files.



38
39
40
# File 'lib/jekyll/task/i18n.rb', line 38

def files
  @files
end

#localesObject

Returns the value of attribute locales.



37
38
39
# File 'lib/jekyll/task/i18n.rb', line 37

def locales
  @locales
end

#translator_emailObject

Returns the value of attribute translator_email.



40
41
42
# File 'lib/jekyll/task/i18n.rb', line 40

def translator_email
  @translator_email
end

#translator_nameObject

Returns the value of attribute translator_name.



39
40
41
# File 'lib/jekyll/task/i18n.rb', line 39

def translator_name
  @translator_name
end

Class Method Details

.define {|task| ... } ⇒ Object

Yields:

  • (task)


28
29
30
31
32
# File 'lib/jekyll/task/i18n.rb', line 28

def define(&block)
  task = new
  yield(task) if block_given?
  task.define
end

Instance Method Details

#defineObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/jekyll/task/i18n.rb', line 53

def define
  namespace :jekyll do
    namespace :i18n do
      namespace :internal do
        task :force
      end

      namespace :po do
        namespace :edit do
          define_edit_po_update_task
        end

        define_po_update_task
      end

      define_translate_task
    end
  end
end