On Mon, 2007-11-19 at 11:30 +0530, Kenneth Gonsalves wrote:
> hi,
> 
> I am running python2.5 and django version 6700. I am getting the  
> error from makemessages.py that 'unnamed arguments cannot be properly  
> localised'. The string complained off is:
> 
> return u"%s %s" %(self.username,self.email)

I bet that isn't the string it's complaining about, since there's no
*gettext() call wrapped around it. Plus it would be kind of a silly
string to mark for translation, since there's nothing to translate in
the string itself.

For when you find the right line: what it's complaining about, though,
is the fact that there are two format markers in the string. Since many
languages require changing the word order around, which means the format
strings might need to be switched as well, when you are translating a
string with multiple format markers in them, you should use the %(foo)s
form. So a line like

        ugettext("%s and %s") % (first, second)
        
should be changed to

        ugettext("%(first)s and %(second)s" % {'first': first, 'second':
        second}

The translator will then see "%(first)s and %(second)s" and even if they
want to switch the ordering, the names of the format strings won't
change and so the right variable will be inserted into the right format
string.

Regards,
Malcolm

-- 
The hardness of butter is directly proportional to the softness of the
bread. 
http://www.pointy-stick.com/blog/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to