def translate_singluar_message(lang, msgid)
return "" if msgid == "" or msgid.nil?
lang_key = lang.to_s
mofile = nil
if self.class.cached?
mofile = @mofiles[lang_key]
end
unless mofile
mofile = load_mo(lang)
end
if (! mofile) or (mofile ==:empty)
return nil
end
msgstr = mofile[msgid]
if msgstr and (msgstr.size > 0)
msgstr
elsif msgid.include?("\000")
ret = nil
msgid_single = msgid.split("\000")[0]
mofile.each{|key, val|
if key =~ /^#{Regexp.quote(msgid_single)}\000/
warn %Q[Warning: n_("#{msgid_single}", "#{msgid.split("\000")[1]}") and n_("#{key.gsub(/\000/, '", "')}") are duplicated.]
ret = val
break
end
}
ret
else
ret = nil
mofile.each{|key, val|
if key =~ /^#{Regexp.quote(msgid)}\000/
ret = val.split("\000")[0]
break
end
}
ret
end
end