Repository: maykinmedia/mail-editor (language: python)

Issue:
Replace ugettext/ugettext_lazy with gettext/gettext_lazy
`ugettext` is deprecated and blocks the upgrade to Django 4.2 for projects that use the mail-editor. See [this PR](https://github.com/maykinmedia/open-inwoner/pull/1024) for OIP.

We should look into and complete the PR started by @ErhanCitil to make the library fit for Django 4.2, which includes updating the CI etc. (PR [https://github.com/maykinmedia/mail-editor/pull/32](https://github.com/maykinmedia/mail-editor/pull/32)), but for now we should at least rename the functions to unblock the Django 4.2 upgrade.


Discussion / hints:

Fix patch:
diff --git a/mail_editor/admin.py b/mail_editor/admin.py
index 5dd0f58..cf35341 100644
--- a/mail_editor/admin.py
+++ b/mail_editor/admin.py
@@ -3,7 +3,7 @@
 from django.contrib import admin
 from django.urls import path, reverse
 from django.utils.html import format_html
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from .forms import MailTemplateForm
 from .models import MailTemplate
diff --git a/mail_editor/helpers.py b/mail_editor/helpers.py
index 3ee8333..1a6bab0 100644
--- a/mail_editor/helpers.py
+++ b/mail_editor/helpers.py
@@ -4,7 +4,7 @@
 from django.contrib.sites.shortcuts import get_current_site
 from django.template import loader
 from django.utils.safestring import mark_safe
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from .models import MailTemplate
 
diff --git a/mail_editor/mail_template.py b/mail_editor/mail_template.py
index 9a2d7c6..9393896 100644
--- a/mail_editor/mail_template.py
+++ b/mail_editor/mail_template.py
@@ -8,7 +8,7 @@
     Context, Template, TemplateSyntaxError
 )
 from django.template.base import VariableNode
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 
 class MailTemplateValidator(object):
diff --git a/mail_editor/models.py b/mail_editor/models.py
index 43be39d..cbe0014 100644
--- a/mail_editor/models.py
+++ b/mail_editor/models.py
@@ -14,7 +14,7 @@
 from django.utils.html import strip_tags
 from django.utils.module_loading import import_string
 from django.utils.safestring import mark_safe
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from .settings import get_config, settings
 from .mail_template import validate_template
diff --git a/mail_editor/views.py b/mail_editor/views.py
index 549158b..e4c6a69 100644
--- a/mail_editor/views.py
+++ b/mail_editor/views.py
@@ -3,7 +3,7 @@
 from django.contrib import messages
 from django.http import HttpResponse
 from django.urls import reverse
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 from django.views.generic import View
 from django.views.generic.detail import DetailView, SingleObjectMixin
 from django.views.generic.edit import FormMixin, FormView


Test patch:
diff --git a/tests/test_admin.py b/tests/test_admin.py
index d9c8827..d32cc1e 100644
--- a/tests/test_admin.py
+++ b/tests/test_admin.py
@@ -2,7 +2,7 @@
 from django.core import mail
 from django.test import TestCase, override_settings
 from django.urls import reverse
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from mail_editor.helpers import find_template
 
diff --git a/tests/test_template_rendering.py b/tests/test_template_rendering.py
index e62e39d..28ddf8a 100644
--- a/tests/test_template_rendering.py
+++ b/tests/test_template_rendering.py
@@ -3,7 +3,7 @@
 
 from django.conf import settings
 from django.test import TestCase, override_settings
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
 
 from mail_editor.models import MailTemplate
 from mail_editor.helpers import find_template