Parent

Methods

GetText::Tools::MsgMerge::Merger

@private

Constants

MAX_FUZZY_DISTANCE
MAX_N_CHARACTERS_DIFFERENCE
POT_DATE_EXTRACT_RE

Merge the reference with the definition: take the #. and

#: comments from the reference, take the # comments from

the definition, take the msgstr from the definition. Add this merged entry to the output message list.

POT_DATE_RE

Public Class Methods

new(reference, definition, config) click to toggle source
# File lib/gettext/tools/msgmerge.rb, line 82
def initialize(reference, definition, config)
  @reference = reference
  @definition = definition
  @translated_entries = @definition.reject do |entry|
    entry.msgstr.nil?
  end
  @config = config
end

Public Instance Methods

merge() click to toggle source
# File lib/gettext/tools/msgmerge.rb, line 91
def merge
  result = GetText::PO.new

  @reference.each do |entry|
    id = [entry.msgctxt, entry.msgid]
    result[*id] = merge_definition(entry)
  end

  add_obsolete_entry(result) if @config.output_obsolete_entries?
  result
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.