开发者

django-admin.py makemessages issues (1) Duplicated message (2) .pot not .po?

Hi I'm working on the Localization of a website frontend, and I met two issues with django-admin.py makemessages -l zh_CN.

1) It's generating .pot files instead of .po files? Why is that? How do I change this?

2) When I'm editing the translation I got this kind of error message "duplicate message definition". It makes sense because I have the same string in different HTML pages, for example, "Login", so it's duplicated. I'm not sure about how to avoid all these duplicated messages? Is there no other ways but to remove all the duplicated ones one by one manually? (I can't delete the strings in poedit)

What I've done is I renamed the .pot file to .po, and manually deleted all the duplicated strings, but I don't think it's the proper way to do? Plus in the future if I need to make any changes, if I d开发者_开发百科o a "django-admin.py makemessages -l zh_CN" again, the .pot file will show up again and I'll have to manually change everything all over again, and all the translation I've done to the .po file would no longer be there... How do I avoid this??

Many thanks in advance for your time and patience!!


All solved. It's because there were errors when I did "makemessage", e.g.

SyntaxError: Translation blocks must not include other block tags: url alerts_main (file: ./templates/default/alerts/base.html)

I've fixed those errors one by one it'll completed generating a .po file without any duplicated message.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜