Trying to run Record in Spanish is causing a problem. I will outline the steps which create this problem. Hopefully someone can clarify where the bug is.<br><br>In Constants.py, we define the following string:<br><br><div style="margin-left: 40px;">
<span style="font-family: courier new,monospace;">#TRANS: photo by photographer, e.g., "Photo by Mary"<br>istrBy = _("%(1)s by %(2)s")</span><br></div><br>Which was picked up when we ran <span style="font-family: courier new,monospace;">
python genpot</span> to create Record.pot.<br><br>A translator kindly translated Record.pot into Spanish to create es.po:<br><br><div style="margin-left: 40px; font-family: courier new,monospace;">#. TRANS: photo by photographer,
e.g., "Photo by Mary"<br>#: constants.py:99<br>#, python-format<br>msgid "%(1)s by %(2)s"<br>msgstr "%(1)s por %(2)s"<br></div><br>Then, we created Record-49.xo by running <span style="font-family: courier new,monospace;">
python setup.py dev </span>and<span style="font-family: courier new,monospace;"> python setup.py dist</span> in the sugar shell. This creates and populates the locale directory with lots of files.<br><br>Then we install the program on an xo and run it.
<br><br>Then we take a picture, and that process tries to assign metadata to a datastory entry, but crashes with this stack trace:<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">--> 371
recd.title = Constants.istrBy % {"1":stringType, "2":str(recd.recorderName)}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> recd.title = None
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> global Constants.istrBy = '%(1) por %(2)'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
stringType = 'Foto'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> global str = undefined</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> recd.recorderName = u'dude face'</span><br><span style="font-family: courier new,monospace;">...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
<type 'exceptions.ValueError'>: unsupported format character 'p' (0x70) at index 5<br></span></div><br><span style="font-family: courier new,monospace;"></span>What is strange is the line <span style="font-family: courier new,monospace;">
Constants.istrBy = '%(1) por %(2)'</span><br><br>This string appears to have lost its "s" at the end of the (1) and the (2) (which we can see were included in the es.po file above). I am not sure how this would have happened, but it does seem to make some sense of the error (the p character being the first thing interpreted after where an s was expected.
<br><br>Any ideas on where we're doing something wrong? Thanks.<br><br>Erik<span style="font-family: courier new,monospace;"></span>