# File lib/gettext/text_domain.rb, line 60
    def translate_singular_message(lang, msgid)
      return "" if msgid.nil?

      lang_key = lang.to_s

      mo = nil
      if self.class.cached?
        mo = @mofiles[lang_key]
      end
      unless mo
        mo = load_mo(lang)
      end

      if (! mo) or (mo ==:empty)
        return nil
      end

      return mo[msgid] if mo.has_key?(msgid)

      ret = nil
      if msgid.include?("\000")
        # Check "aaa\000bbb" and show warning but return the singular part.
        msgid_single = msgid.split("\000")[0]
        msgid_single_prefix_re = /^#{Regexp.quote(msgid_single)}\000/
        mo.each do |key, val|
          if msgid_single_prefix_re =~ key
            # Usually, this is not caused to make po-files from rgettext.
            separated_msgid = msgid.gsub(/\000/, '", "')
            duplicated_msgid = key.gsub(/\000/, '", "')
            warn("Warning: " +
                  "n_(\"#{separated_msgid}\") and " +
                  "n_(\"#{duplicated_msgid}\") " +
                  "are duplicated.")
            ret = val
            break
          end
        end
      else
        plural_msgid_prefix = "#{msgid}\000"
        mo.each do |key, val|
          next unless Encoding.compatible?(key, plural_msgid_prefix)
          next unless key.start_with?(plural_msgid_prefix)
          ret = val.split("\000")[0]
          break
        end
      end
      ret
    end