makemessages error. Please help!

1,347 views
Skip to first unread message

whitelotus

unread,
Feb 10, 2014, 10:44:43 PM2/10/14
to django...@googlegroups.com, zhao...@umn.edu

Hi, all,

To create the message file, I did "django-admin.py makemessages -l zh_CN". It popped out the following error which I couldn't find on the web. Could anyone tell me the reason why this happened, please? <app path> is the absolute app path which is right. I tried "touch <app path>/locale/django.pot", but it still complained the same error and it seemed that msguniq deleted this file. I also tried "django-admin.py makemessages --keep-pot -l zh_CN" which didn't work either. Thank you.

processing locale zh_CN
CommandError: errors happened while running msguniq
msguniq: error while opening "<app path>/locale/django.pot" for reading: No such file or directory

carlos

unread,
Feb 11, 2014, 12:23:58 AM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
hi maybe you need configure the setting put path for you locale dirs

LOCALE_PATHS = (
    os.path.join(SITE_ROOT,'locale'),
)


Cheers


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8ff2f353-7e26-4fcb-90a8-9e5d34e77399%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

whitelotus

unread,
Feb 11, 2014, 8:17:40 AM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
Hi, 

Thank you for the help. I did have configured the LOCALE_PATHS in setting.py, which looks:

 85 LOCALE_PATHS = (                                                                                    
 86     os.path.join(os.path.dirname(__file__), 'locale').replace('\\', '/'),                           
 87 )

Any other ideas, please? Thanks.

Best,
Qian

在 2014年2月10日星期一UTC-6下午11时23分58秒,sacrac写道:

Vianney Gremmel

unread,
Feb 11, 2014, 8:43:28 AM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
Is gettext installed on your machine ? 

whitelotus

unread,
Feb 11, 2014, 9:11:47 AM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
Yes it's installed. As follows, I'm using ubuntu12.04. Thanks.

$sudo apt-get install gettext
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gettext is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.

在 2014年2月11日星期二UTC-6上午7时43分28秒,Vianney Gremmel写道:

Vianney Gremmel

unread,
Feb 11, 2014, 9:24:52 AM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
Well, according to a question on stackoverflow, this message appears when you don't have any message to translate in your app.. maybe you could check it ?

whitelotus

unread,
Feb 11, 2014, 7:44:24 PM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
Thank you. It's working now. The strange thing is that I did have strings to translate in the template but without strings to translate in py, it complained like that. When I added something to translate in py, it works. 


在 2014年2月11日星期二UTC-6上午8时24分52秒,Loutre写道:

whitelotus

unread,
Feb 11, 2014, 7:48:39 PM2/11/14
to django...@googlegroups.com, zhao...@umn.edu
I think I got it right. I forgot to add quotes for the strings to translate in trans tag. Thank you all. 

在 2014年2月11日星期二UTC-6上午8时24分52秒,Loutre写道:
Reply all
Reply to author
Forward
0 new messages