110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
# File 'lib/gettext/rmsgmerge.rb', line 110
def generate_po_entry(msgid)
str = ""
str << [msgid]
if str[-1] != "\n"[0]
str << "\n"
end
id = msgid.gsub(/"/, '\"').gsub(/\r/, '')
msgstr = @msgid2msgstr[msgid].gsub(/"/, '\"').gsub(/\r/, '')
if id.include?("\000")
ids = id.split(/\000/)
str << "msgid " << __conv(ids[0]) << "\n"
ids[1..-1].each do |single_id|
str << "msgid_plural " << __conv(single_id) << "\n"
end
msgstr.split("\000").each_with_index do |m, n|
str << "msgstr[#{n}] " << __conv(m) << "\n"
end
else
str << "msgid " << __conv(id) << "\n"
str << "msgstr " << __conv(msgstr) << "\n"
end
str << "\n"
str
end
|