Class: GetText::Tools::MsgMerge::Merger

### Home Classes Methods

### In Files

- lib/gettext/tools/msgmerge.rb

### Parent

Object

### Methods

- ::new
- #merge

### Class/Module Index

Quicksearch

- GetText
- GetText::ClassInfo
- GetText::ErbParser
- GetText::GladeParser
- GetText::LocalePath
- GetText::MO
- GetText::MO::HeaderRev1
- GetText::MO::InvalidFormat
- GetText::NoboundTextDomainError
- GetText::PO
- GetText::PO::NonExistentEntryError
- GetText::POEntry
- GetText::POEntry::Formatter
- GetText::POEntry::InvalidTypeError
- GetText::POEntry::NoMsgctxtError
- GetText::POEntry::NoMsgidError
- GetText::POEntry::NoMsgidPluralError
- GetText::POEntryForRubyParser
- GetText::POFormat
- GetText::POParser
- GetText::ParseError
- GetText::RubyParser
- GetText::TextDomain
- GetText::TextDomainGroup
- GetText::TextDomainManager
- GetText::Tools
- GetText::Tools::MsgCat
- GetText::Tools::MsgCat::Config
- GetText::Tools::MsgCat::Merger
- GetText::Tools::MsgInit
- GetText::Tools::MsgInit::ArgumentError
- GetText::Tools::MsgInit::Error
- GetText::Tools::MsgInit::ValidationError
- GetText::Tools::MsgMerge
- GetText::Tools::MsgMerge::Config
- GetText::Tools::MsgMerge::FuzzyEntryFinder
- GetText::Tools::MsgMerge::Merger
- GetText::Tools::Task
- GetText::Tools::Task::Error
- GetText::Tools::Task::Path
- GetText::Tools::Task::ValidationError
- GetText::Tools::XGetText

No matching classes.

# GetText::Tools::MsgMerge::Merger

@private

### Constants

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
      @fuzzy_entry_finder = FuzzyEntryFinder.new(@translated_entries)
      @config = config
    end

### Public Instance Methods

merge() click to toggle source

    # File lib/gettext/tools/msgmerge.rb, line 92
    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.