mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
email: Fix regression error when installing/operation app
- In tags cleanup code, the front page shortcut for email uses different tags than those provided in the manifest. When the app is instantiated in privileged code without setting up Django, this causes an error even though gettext_noop is used. Workaround by using a custom method for this. Tests: - Installing, enabling/disabling email apps works. - 'make update-translations' output shows that django.pot has been updated and the tags in question are part of the POT file. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
28e4fe0791
commit
17ff564eeb
@ -5,7 +5,6 @@ import logging
|
||||
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.utils.translation import gettext_noop
|
||||
|
||||
import plinth.app
|
||||
from plinth import cfg, frontpage, menu
|
||||
@ -19,7 +18,7 @@ from plinth.modules.letsencrypt.components import LetsEncrypt
|
||||
from plinth.package import Packages
|
||||
from plinth.privileged import service as service_privileged
|
||||
from plinth.signals import domain_added, domain_removed
|
||||
from plinth.utils import format_lazy
|
||||
from plinth.utils import format_lazy, gettext_noop
|
||||
|
||||
from . import aliases, manifest, privileged
|
||||
|
||||
|
||||
@ -192,3 +192,8 @@ class SafeFormatter(string.Formatter):
|
||||
return super().get_field(field_name, args, kwargs)
|
||||
except (AttributeError, TypeError):
|
||||
return (f'?{field_name}?', '')
|
||||
|
||||
|
||||
def gettext_noop(message: str) -> str:
|
||||
"""Do nothing. Using this method marks the string for translation."""
|
||||
return message
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user