Repository: UTNkar/moore

Issue:
Translations misbehaving
<!--

Do you want to ask a question? Are you looking for support? The system
administrator can help you: admin@utn.se

-->

### Prerequisites

* [x ] Put an X between the brackets on this line if you have done all of the
following:
    * Reproduced the problem with clear cache.
    * (If running the application locally:) Made sure your running the newest
    version on the master branch
    * Checked that your issue isn't already filed:
    https://github.com/UTNkar/moore/issues

### Description

When you change between languages in the home page and then enter the admin page the translations for groups teams and roles (maybe more) does not change in the sidebar menus. The problem is not consistent since It was possible to change it to Swedish once but then you could not switch back to English and vice versa.

### Steps to Reproduce

1. Go to home page
2. Go to admin interface
3. Go back to home page and change language
4. Go to admin interface. Check the translations for teams roles groups etc.

**Expected behavior:**
Translation working changing between Swedish and English

**Actual behavior:** [What actually happens]
It translates only parts of the admin page
**Reproduces how often:** [What percentage of the time does it reproduce?]
Don't know
### Additional Information

Any additional information, configuration or data that might be necessary to
reproduce the issue.



Discussion:
This seems to be because of the use of the default menu label (`wagtail_hooks.py`). This means that it requests the names from model Meta, which must have been cached for some reason

The easy solution would be to use the labels directly.

Resolving patch:
diff --git a/website/involvement/wagtail_hooks.py b/website/involvement/wagtail_hooks.py
--- a/website/involvement/wagtail_hooks.py
+++ b/website/involvement/wagtail_hooks.py
@@ -16,6 +16,7 @@
 
 class TeamAdmin(ModelAdmin):
     model = Team
+    menu_label = _('Teams')
     menu_icon = 'group'
     menu_order = 100
     list_display = ('name_en', 'name_sv', 'email')
@@ -48,6 +49,7 @@ def get_queryset(self, request):
 
 class RoleAdmin(ModelAdmin):
     model = Role
+    menu_label = _('Roles')
     menu_icon = 'user'
     menu_order = 200
     list_display = ('team', 'name_en', 'name_sv', 'archived')
@@ -195,6 +197,7 @@ def get_buttons_for_obj(self, obj, exclude=None, classnames_add=None,
 
 class PositionAdmin(ModelAdmin):
     model = Position
+    menu_label = _('Positions')
     menu_icon = 'search'
     menu_order = 300
     list_display = ('role', 'appointments', 'term_from', 'term_to')
@@ -228,6 +231,7 @@ def get_queryset(self, request):
 
 class ApplicationAdmin(ModelAdmin):
     model = Application
+    menu_label = _('Applications')
     menu_icon = 'mail'
     menu_order = 400
     list_display = ('position', 'applicant', 'status')
diff --git a/website/website/settings/base.py b/website/website/settings/base.py
--- a/website/website/settings/base.py
+++ b/website/website/settings/base.py
@@ -45,7 +45,6 @@
     'wagtail.contrib.settings',
     'wagtail.contrib.modeladmin',
     "wagtail.contrib.wagtailroutablepage",
-    "wagtail.contrib.wagtailstyleguide",
 
     'modelcluster',
     'taggit',


Test patch: