Django Translation won't work

16 views
Skip to first unread message

sebasti...@gmail.com

unread,
May 21, 2023, 2:36:12 PM5/21/23
to Django users
I use django translation. Normal works perfect but now i have a problem. All verbose name are in english in django code. I setting.py i have as second language DE configure. Then i have in models.py:

condition_link = models.ForeignKey(related, null=True, blank=True, default=None, on_delete=models.CASCADE,verbose_name=_('Condition'),
                                       related_name="condition_link")

in django.po in DE Language i don't find anything with

msgid "Condition"

in form.py i have:

evalfield = self.Meta.model._meta.get_field('condition_link')
self.fields['condition_link'] = forms.MultipleChoiceField(choices=evalfield.choices,
                    widget=SelectMultiple(),
                    label=evalfield.verbose_name)

and i get in evalfield.verbose_name a translation which are don't exists in django.po file. I also delete django.mo file and make django-admin compilemessages --locale DE so .mo file is new created.

Same thing.

Then next problem on django translation i have a translation:

#: catalogue/models.py:81
msgid "Gender"
msgstr "Geschlecht"

in frontend msgstr Geschlecht are shown both in english and in german language...

99% other translation works right...

Have anyone a idea what it could be? This is absolut strange

Sebastian Jung

unread,
May 21, 2023, 2:40:11 PM5/21/23
to django...@googlegroups.com
I have delete complete django.po file and make new one and only make a translation for Gender to Geschlecht and same thing happens that in Englisch Language and in German Language both show Geschlecht...

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/09d0d1cb-875c-45ce-a9d8-716d7fe08175n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages