Wednesday, May 29, 2019

Multiple models files under a folder may cause error when makemessages

As I only have one app but with many models, so I split the models into separate files under a model folder.
It works well until I run makemessages and it gives out error messages sort of like this:


CommandError: errors happened while running msguniq
E:\Projects\as\locale\django.pot:353:3: syntax error
E:\Projects\as\locale\django.pot:353: keyword "main" unknown
E:\Projects\as\locale\django.pot:353: keyword "models" unknown
E:\Projects\as\locale\django.pot:353: keyword "log" unknown
E:\Projects\as\locale\django.pot:353: keyword "py" unknown
E:\Projects\as\locale\django.pot:353: keyword "main" unknown
E:\Projects\as\locale\django.pot:353: keyword "models" unknown
E:\Projects\as\locale\django.pot:353: keyword "py" unknown
E:\Projects\as\locale\django.pot:355: keyword "main" unknown
E:\Projects\as\locale\django.pot:355: keyword "models" unknown
E:\Projects\as\locale\django.pot:355: keyword "py" unknown
E:\Projects\as\locale\django.pot:355: keyword "main" unknown
E:\Projects\as\locale\django.pot:355: keyword "models" unknown
E:\Projects\as\locale\django.pot:355: keyword "py" unknown
msguniq: found 14 fatal errors
 

then I rename the original folder and combine all the models into a single file for substitution.
but the error still occurs until I move the original folder out from the project.
so I think it is the problem of how Django parse the directories?




--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cd6028c5-00ef-47ff-ae56-e1633cab45e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment