Am 16.02.10 17:53, schrieb zaf:
Okay well here's a paste of JS code that fail :
http://pastebin.com/m1e7207c6

What's very weird, is that after some debugging,I realized line 10
failed but not the others and only one string in line 10 actually
fails.

I did this to figure out the problem : (this is in turbogears/command/
i18n.py, line 483)

     def _write_potfile_entries(self, potfile, messages):
         if messages:
             fd = open(potfile, 'at+')
             for linenumber, fname, text in messages:
                 if text == '':
                     continue
                 print 'Original, ',type(text), text, fname, linenumber
                 text = catalog.normalize(text.encode('utf-8'))
                 fd.write('#: %s:%s\n' % (fname, linenumber))
                 fd.write('msgid %s\n' % text)
                 fd.write('msgstr ""\n\n')
             fd.close()

  and this is the output I get for line 10 :

Original,<type 'unicode'>   clé(s) envoyée(s). cinego/static/
javascript/film.js 222

Original,<type 'str'>  Afficher le détail cinego/static/javascript/
film.js 222

I don't understand why one string would be typed as string and another
as unicode.
I'm guessing it's got to do with my typing of the strings but I really
don't see what's wrong.

Well, that's pretty simple: you saved them in some different encoding than UTF-8. Which is required for the command to work (there might be some parameter to determine the encoding, I don't remember that).

And shuffling the files around might have convinced your editor to store them as UTF-8 by accident. Whatever editor you use, you should try & figure out how to convince it to save in utf-8 by default.

Diez

--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to