Django 4.2.16
My code contains this line (beside lots more i18n texts):
filter_text = _('Filter')
I generate the “de” locale po file:
django-admin makemessages --locale de -i venv
The resulting po file is corrupt (see missing prefix “#:”):
#: .oamviewsarticlearticle_list.py:138
#: .oamviewsfillupfillup_list.py:109
#: .oamviewssettingsetting_list.py:49
.oamviewsstockstock_list.py:75
#: .oamviewstom_articletom_article_list.py:53
#: .oamviewstransactiontransaction_list.py:90
msgid "Filter"
msgstr "Filter"
Running makemessages again of course leads into errors:
CommandError: errors happened while running msgmerge
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915:3: syntax error
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915: keyword "oam" unknown
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915: keyword "views" unknown
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915: keyword "stock" unknown
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915: keyword "stock_list" unknown
c:workproapollooamlocaledeLC_MESSAGESdjango.po:1915: keyword "py" unknown
msgmerge: found 6 fatal errors
When removing the i18n at this line the makemessages works well:
filter_text = 'Filter'
I’m totally lost. Any hints? Thanks!
3