def to_po_str
raise "msgid is nil." unless @msgid
raise "sources is nil." unless @sources
str = ""
if comment
comment.split("\n").each do |comment_line|
str << "\n#. #{comment_line.strip}"
end
end
curr_pos = @@max_line_length
sources.each do |e|
if curr_pos + e.size > @@max_line_length
str << "\n#:"
curr_pos = 3
else
curr_pos += (e.size + 1)
end
str << " " << e
end
str << "\nmsgctxt \"" << msgctxt << "\"" if msgctxt?
str << "\nmsgid \"" << escaped(:msgid) << "\"\n"
if plural?
str << "msgid_plural \"" << escaped(:msgid_plural) << "\"\n"
str << "msgstr[0] \"\"\n"
str << "msgstr[1] \"\"\n"
else
str << "msgstr \"\"\n"
end
str
end