Weblate有一个名为“更新PO文件以匹配POT (msgmerge)”的插件。我希望将.po文件的创建委托给Weblate,并且只使用manage.py makemessages创建.pot文件。
manage.py makemessages有一个--keep-pot选项,它将.pot文件添加到输出中。不幸的是,没有选择只保留.pot文件。
发布于 2021-10-15 12:12:35
可以通过覆盖.po命令的write_po_file方法来跳过创建makemessages文件。为此,在management/commands中创建一个management/commands文件(如姜戈博士中所述):
# management/commands/makemessages.py
class Command(makemessages.Command):
def write_po_file(*args, **kwargs):
"""Overwrite method to do nothing.
We do not want to interfere with Weblate's
"Update PO files to match POT (msgmerge)" addon
"""
passhttps://stackoverflow.com/questions/69584522
复制相似问题