lib/gettext/tools/rmsgmerge.rb
# From GNU gettext source.
# 
# 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.      
From GNU gettext source.
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.
From GNU gettext source . 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 .
def merge_message(msgid, target, def_msgid, definition)
        merge_comment(msgid, target, def_msgid, definition)
        def_msgstr = definition[def_msgid]
        if msgid.index("\000")
          if def_msgstr.index("\000")
            target[msgid] = def_msgstr			
          else
            s = ''            
            definition.nplural.times {
              s << def_msgstr
              s << "\000"
            }
            target[msgid] = s
          end
        else
          if def_msgstr.index("\000")
            target[msgid] = def_msgstr.split("\000")[0]
          else
            target[msgid] = def_msgstr
          end
        end
      end
def merge_message ( msgid , target , def_msgid , definition ) merge_comment ( msgid , target , def_msgid , definition ) def_msgstr = definition [ def_msgid ] if msgid . index ( "\000" ) if def_msgstr . index ( "\000" ) target [ msgid ] = def_msgstr else s = '' definition . nplural . times { s << def_msgstr s << "\000" } target [ msgid ] = s end else if def_msgstr . index ( "\000" ) target [ msgid ] = def_msgstr . split ( "\000" ) [ 0 ] else target [ msgid ] = def_msgstr end end end
From GNU gettext source.
From GNU gettext source .
############################################ # check mismatch of msgid and msgid_plural # ############################################ # OK # NG # NG # OK
msgid
<not_specific>
target
<not_specific>
def_msgid
<not_specific>
definition
<not_specific>