if msgstr == '':
# Don't generate a stmt for an untranslated string
break
- self.sql.append(insert % (identifier.group('class'), occurid, locale, msgstr))
+ self.sql.append(unicode(insert % (identifier.group('class'), occurid, locale, msgstr), 'utf_8'))
def main():
"""
Source event definitions are structured as follows:
{
- MSG_ID1: "This is a message with 1 variable - ${0}.",
- MSG_ID2: "This is a message with two variables: ${0} and ${1}."
+ "MSG_ID1": "This is a message with 1 variable - ${0}.",
+ "MSG_ID2": "This is a message with two variables: ${0} and ${1}."
}
Note that this is a deliberately limited subset of the variable substitution
for name in entry.occurrences:
if entry.msgstr == '':
# No translation available; use the en-US definition
- self.definitions.append(entity % (name[0], entry.msgid))
+ self.definitions.append(unicode(entity % (name[0], entry.msgid), 'utf_8'))
else:
- self.definitions.append(entity % (name[0], entry.msgstr))
+ self.definitions.append(unicode(entity % (name[0], entry.msgstr), 'utf_8'))
class IDLHandler(xml.sax.handler.ContentHandler):
"""
if entry.msgstr == '':
# No translation available; use the en-US definition
- self.definitions.append(event % (int(numcode), textcode, self.locale, entry.msgid))
+ self.definitions.append(unicode(event % (int(numcode), textcode, self.locale, entry.msgid), 'utf_8'))
else:
- self.definitions.append(event % (int(numcode), textcode, self.locale, entry.msgstr))
+ self.definitions.append(unicode(event % (int(numcode), textcode, self.locale, entry.msgstr), 'utf_8'))
class ILSEventHandler(xml.sax.handler.ContentHandler):
"""