Class: GetText::Tools::MsgCat::Merger

### Home Classes Methods

### In Files

- lib/gettext/tools/msgcat.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::MsgCat::Merger

@private

### Public Class Methods

new(output_po, config) click to toggle source

    # File lib/gettext/tools/msgcat.rb, line 69
    def initialize(output_po, config)
      @output_po = output_po
      @config = config
    end

### Public Instance Methods

merge(po) click to toggle source

    # File lib/gettext/tools/msgcat.rb, line 74
    def merge(po)
      po.each do |entry|
        if entry.msgid == :last
          next unless @config.output_obsolete_entries?
        end
        id = [entry.msgctxt, entry.msgid]
        if @output_po.has_key?(*id)
          merged_entry = merge_entry(@output_po[*id], entry)
        else
          merged_entry = entry
        end
        next unless merged_entry
        remove_header_fields!(merged_entry) if merged_entry.header?
        @output_po[*id] = merged_entry
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.