'Avoid dyanmic content's translation in msgstr

I am using Django translations for ja and de using makemessage. There is a translation in that I don't want to translate dynamic content in de.

I am using the following translations.

msgid " and %(level3)s subgroups"
msgstr "und aller Untergruppen von %(level3)s "

But now I don't want to use dynamic content 'level3' in msgstr. I simply need need und aller Untergruppen von.

so I changed it to

msgid " and %(level3)s subgroups"
msgstr "und aller Untergruppen von "

but while doing compilemessages it's getting error

CommandError: Execution of msgfmt failed: /Users/treeni/treeni_produts/sustain-online/so-web/locale/de/LC_MESSAGES/django.po:4409: a format specification for argument 'level3' doesn't exist in 'msgstr'
msgfmt: found 1 fatal error


Solution 1:[1]

Remove any comment which starts with #, python before needed message.

Example:

Before:

#: venv/lib/python3.10/site-packages/django/db/models/fields/__init__.py:129
#, python-format
msgid "Value %(value)r is not a valid choice."
msgstr ""

After:

#: venv/lib/python3.10/site-packages/django/db/models/fields/__init__.py:129
msgid "Value %(value)r is not a valid choice."
msgstr ""

Good day!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 antipups