Fix bug footer menu items not translated

This commit is contained in:
PCoder 2024-07-19 14:04:15 +05:30
parent 31a0a6b060
commit 780a4ce2d7

View file

@ -78,15 +78,13 @@ def menuitems_children(parent, context=None):
items_to_remove = []
for menuitem in menuitems_children:
try:
if type(menuitem) == ContactForm:
menuitem.title = menuitem.title
else:
menuitem.title = menuitem.trans_title
if 'devenez' in menuitem.title.lower() and remove_devenez:
items_to_remove.append(menuitem)
elif 'mitglied werden' in menuitem.title.lower() and remove_mitglied:
items_to_remove.append(menuitem)
menuitem.title = menuitem.trans_title
except AttributeError:
print("Menuitem %s has an issue :: %s" % (menuitem.title, str(ae)))
pass
for item in items_to_remove:
menuitems_children = menuitems_children & Page.objects.not_page(item)