Repository: django-cms/django-filer

Issue:
Field verbose_name should use gettext_lazy
Hi, 
model field verbose_names should use gettext_lazy, because it creates migrations based on user language settings. 

https://github.com/django-cms/django-filer/blob/master/filer/models/foldermodels.py#L9

This is migration generated after upgrade to django-filer 3.0
![image](https://github.com/django-cms/django-filer/assets/10236315/f3cdd97e-dcfe-449b-a928-a574976417da)

Thanks.


Discussion:
Or maybe I am just wrong and it doesn't help, just a guess.
@mihalikv No, you're right.

As a general rule;

`gettext_lazy()` should be used for anything loaded at runtime:
* `models.py` (fields, `verbose_name`, `help_text`, function `short_description`);
* `forms.py` (`labels`, `help_text`, `empty_label`);
* `apps.py` (`verbose_name`).

`gettext()`should be used for any modules that are executed during the request process, such as `views.py`

Resolving patch:
diff --git a/filer/__init__.py b/filer/__init__.py
--- a/filer/__init__.py
+++ b/filer/__init__.py
@@ -13,4 +13,4 @@
  8. Publish the release and it will automatically release to pypi
 """
 
-__version__ = '3.0.6'
+__version__ = '3.1.0'
diff --git a/filer/admin/imageadmin.py b/filer/admin/imageadmin.py
--- a/filer/admin/imageadmin.py
+++ b/filer/admin/imageadmin.py
@@ -1,4 +1,6 @@
 from django import forms
+from django.shortcuts import get_object_or_404, render
+from django.urls import path
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext_lazy
 
@@ -80,19 +82,24 @@ class Meta:
         model = Image
         exclude = ()
 
-    class Media:
-        css = {
-            # 'all': (settings.MEDIA_URL + 'filer/css/focal_point.css',)
-        }
-        js = (
-
-        )
-
 
 class ImageAdmin(FileAdmin):
     change_form_template = 'admin/filer/image/change_form.html'
     form = ImageAdminForm
 
+    def get_urls(self):
+        return super().get_urls() + [
+            path("expand/<int:file_id>",
+                 self.admin_site.admin_view(self.expand_view),
+                 name=f"filer_{self.model._meta.model_name}_expand_view")
+        ]
+
+    def expand_view(self, request, file_id):
+        image = get_object_or_404(self.model, pk=file_id)
+        return render(request, "admin/filer/image/expand.html", context={
+            "original_url": image.url
+        })
+
 
 if FILER_IMAGE_MODEL == 'filer.Image':
     extra_main_fields = ('author', 'default_alt_text', 'default_caption',)


Test patch:
diff --git a/tests/test_admin.py b/tests/test_admin.py
--- a/tests/test_admin.py
+++ b/tests/test_admin.py
@@ -338,6 +338,20 @@ def test_detail_view_missing_file(self):
         self.assertContains(response, 'height="210"')
         self.assertContains(response, 'alt="File is missing"')
 
+    def test_image_expand_view(self):
+        url = reverse("admin:filer_image_expand_view", kwargs={
+            'file_id': self.file_object.pk
+        })
+        original_url = self.file_object.url
+
+        response = self.client.get(url)
+
+        self.assertContains(response, f"""<html>
+    <body style="margin: 0;">
+        <img style="max-width: 100%" src="{original_url}" />
+    </body>
+</html>""")
+
 
 class FilerClipboardAdminUrlsTests(TestCase):
     def setUp(self):
@@ -1818,7 +1832,6 @@ def test_admin_url_params(self):
 
 
 class FileIconContextTests(TestCase):
-
     def test_image_icon_with_size(self):
         """
         Image with get an aspect ratio and will be present in context