Parent

Methods

Included Modules

GetText::Tools::MsgInit

Public Class Methods

new() click to toggle source
# File lib/gettext/tools/msginit.rb, line 53
def initialize
  @input_file = nil
  @output_file = nil
  @locale = nil
  @language = nil
  @entry = nil
  @comment = nil
  @translator = nil
  @set_translator = true
  @translator_name = nil
  @translator_eamil = nil
end
run(*arguments) click to toggle source

Create a new .po file from initializing .pot file with user's environment and input. @param [Array<String>] arguments arguments for rmsginit. @return [void]

# File lib/gettext/tools/msginit.rb, line 44
def run(*arguments)
  new.run(*arguments)
end

Public Instance Methods

run(*arguments) click to toggle source

Create .po file from .pot file, user's inputs and metadata. @param [Array] arguments the list of arguments for rmsginit

# File lib/gettext/tools/msginit.rb, line 68
def run(*arguments)
  parse_arguments(*arguments)
  validate

  parser = POParser.new
  parser.ignore_fuzzy = false
  pot = parser.parse_file(@input_file, GetText::PO.new)
  po = replace_pot_header(pot)

  File.open(@output_file, "w") do |f|
    f.puts(po.to_s)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.