import sys
import xml.sax
import xml.sax.handler
+import xml.sax.saxutils
class IDL(basel10n.BaseL10N):
"""
"""
Creates an entity definition file based on a translated PO file.
"""
- entity = '<!ENTITY %s "%s">'
+ entity = '<!ENTITY %s %s>'
for entry in self.pot:
for name in entry.occurrences:
+ entdef = xml.sax.saxutils.quoteattr(entry.msgstr)
if entry.msgstr == '':
# No translation available; use the en-US definition
- self.definitions.append(entity % (name[0], entry.msgid))
- else:
- self.definitions.append(entity % (name[0], entry.msgstr))
+ entdef = xml.sax.saxutils.quoteattr(entry.msgid)
+ self.definitions.append(entity % (name[0], entdef))
class IDLHandler(xml.sax.handler.ContentHandler):
"""
<!ENTITY class.auoi.label "venenatis, mi nisl">
<!ENTITY field.rodcirc.recurring_fine_rule.label "suscipit sapien, eu sollicitudin">
<!ENTITY field.rodcirc.duration_rule.label "neque dolor a nulla">
-<!ENTITY field.auoi.id.label "Phasellus aliquam vulputate justo">
+<!ENTITY field.auoi.id.label 'Phasellus " aliquam vulputate justo'>
<!ENTITY field.rodcirc.payment_total.label "Proin augue libero">
<!ENTITY field.rodcirc.phone_renewal.label "hendrerit pretium">
<!ENTITY field.rodcirc.circ_lib.label "rutrum pretium">
<!ENTITY field.auoi.opt_in_ts.label "sapien id velit nonummy">
<!ENTITY field.rodcirc.desk_renewal.label "congue, neque">
<!ENTITY field.rodcirc.target_copy.label "ut ullamcorper faucibus">
-<!ENTITY field.rodcirc.renewal_remaining.label "diam felis">
+<!ENTITY field.rodcirc.renewal_remaining.label "diam felis<">
<!ENTITY field.aws.owning_lib.label "Owning Library">
<!ENTITY field.rodcirc.id.label "pulvinar augue">
#: field.auoi.id.label:25
msgid "Opt-in ID"
-msgstr "Phasellus aliquam vulputate justo"
+msgstr "Phasellus \" aliquam vulputate justo"
#: field.rodcirc.payment_total.label:86
msgid "Payment Totals"
#: field.rodcirc.renewal_remaining.label:74
msgid "Remaining Renewals"
-msgstr "diam felis"
+msgstr "diam felis<"
#: field.aws.owning_lib.label:46
msgid "Owning Library"