🐛(domains) fix admin information messages not translated
Using format or f-string breaks translations
This commit is contained in:
Binary file not shown.
@@ -333,17 +333,17 @@ msgstr "Synchroniser à partir de dimail"
|
|||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:35 mailbox_manager/admin.py:35
|
#: build/lib/mailbox_manager/admin.py:35 mailbox_manager/admin.py:35
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Synchronisation failed for {domain.name} with message: [{err}]"
|
msgid "Synchronisation failed for %(domain)s with message: %(err)s"
|
||||||
msgstr "La synchronisation a échoué pour {domain.name} avec le message : [{err}]"
|
msgstr "La synchronisation a échoué pour %(domain)s avec le message : %(err)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:41 mailbox_manager/admin.py:41
|
#: build/lib/mailbox_manager/admin.py:41 mailbox_manager/admin.py:41
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Synchronisation succeed for {domain.name}. "
|
msgid "Synchronisation succeed for %(domain)s. Imported mailboxes: %(mailboxes)s"
|
||||||
msgstr "La synchronisation a réussi pour {domain.name}. "
|
msgstr "La synchronisation a réussi pour %(domain)s. Importation des boîtes mails : %(mailboxes)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:49 mailbox_manager/admin.py:49
|
#: build/lib/mailbox_manager/admin.py:49 mailbox_manager/admin.py:49
|
||||||
msgid "Sync require enabled domains. Excluded domains: {', '.join(excluded_domains)}"
|
msgid "Sync require enabled domains. Excluded domains: %(domains)s"
|
||||||
msgstr "La synchro nécessite des domaines activés. Les domaines exclus sont : {', '.join(excluded_domains)}"
|
msgstr "La synchro nécessite des domaines activés. Les domaines exclus sont : %(domains)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:54 mailbox_manager/admin.py:54
|
#: build/lib/mailbox_manager/admin.py:54 mailbox_manager/admin.py:54
|
||||||
msgid "Check and update status from dimail"
|
msgid "Check and update status from dimail"
|
||||||
@@ -351,16 +351,16 @@ msgstr "Vérifier et mettre à jour le statut à partir de dimail"
|
|||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:70 mailbox_manager/admin.py:70
|
#: build/lib/mailbox_manager/admin.py:70 mailbox_manager/admin.py:70
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "- {domain.name} with message: '{err}'"
|
msgid "- %(domain)s with message: %(err)s"
|
||||||
msgstr "- {domain.name} avec le message : '{err}'"
|
msgstr "- %(domain)s avec le message : %(err)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:81 mailbox_manager/admin.py:81
|
#: build/lib/mailbox_manager/admin.py:81 mailbox_manager/admin.py:81
|
||||||
msgid "Check domains done with success."
|
msgid "Check domains done with success."
|
||||||
msgstr "Vérification des domaines effectuée avec succès."
|
msgstr "Vérification des domaines effectuée avec succès."
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:82 mailbox_manager/admin.py:82
|
#: build/lib/mailbox_manager/admin.py:82 mailbox_manager/admin.py:82
|
||||||
msgid "Domains updated: {', '.join(domains_updated)}"
|
msgid "Domains updated: %(domains)s"
|
||||||
msgstr "Domaines mis à jour : {', '.join(domains_updated)}"
|
msgstr "Domaines mis à jour : %(domains)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:84 mailbox_manager/admin.py:84
|
#: build/lib/mailbox_manager/admin.py:84 mailbox_manager/admin.py:84
|
||||||
msgid "No domain updated."
|
msgid "No domain updated."
|
||||||
@@ -371,26 +371,26 @@ msgid "Check domain failed for:"
|
|||||||
msgstr "La vérification du domaine a échoué pour :"
|
msgstr "La vérification du domaine a échoué pour :"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:100 mailbox_manager/admin.py:100
|
#: build/lib/mailbox_manager/admin.py:100 mailbox_manager/admin.py:100
|
||||||
msgid "Domains disabled are excluded from check: {', '.join(excluded_domains)}"
|
msgid "Domains disabled are excluded from check: %(domains)s"
|
||||||
msgstr "Les domaines désactivés sont exclus de la vérification : {', '.join(excluded_domains)}"
|
msgstr "Les domaines désactivés sont exclus de la vérification : %(domains)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:105 mailbox_manager/admin.py:105
|
#: build/lib/mailbox_manager/admin.py:105 mailbox_manager/admin.py:105
|
||||||
msgid "Fetch domain expected config from dimail"
|
msgid "Fetch domain expected config from dimail"
|
||||||
msgstr "Récupérer la configuration attendue du domaine depuis dimail"
|
msgstr "Récupérer la configuration attendue du domaine depuis dimail"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:119 mailbox_manager/admin.py:119
|
#: build/lib/mailbox_manager/admin.py:119 mailbox_manager/admin.py:119
|
||||||
#, python-brace-format
|
#, python-format
|
||||||
msgid "Domain expected config fetched with success for {domain.name}."
|
msgid "Domain expected config fetched with success for %(domain)s."
|
||||||
msgstr "La configuration du domaine attendue a été récupérée avec succès pour {domain.name}."
|
msgstr "La configuration du domaine attendue a été récupérée avec succès pour %(domain)s."
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:123 mailbox_manager/admin.py:123
|
#: build/lib/mailbox_manager/admin.py:123 mailbox_manager/admin.py:123
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Failed to fetch domain expected config for {domain.name}."
|
msgid "Failed to fetch domain expected config for %(domain)s."
|
||||||
msgstr "Impossible de récupérer la configuration attendue pour {domain.name}."
|
msgstr "Impossible de récupérer la configuration attendue pour %(domain)s."
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/admin.py:129 mailbox_manager/admin.py:129
|
#: build/lib/mailbox_manager/admin.py:129 mailbox_manager/admin.py:129
|
||||||
msgid "Domains disabled are excluded from fetch: {', '.join(excluded_domains)}"
|
msgid "Domains disabled are excluded from fetch: %(domains)s"
|
||||||
msgstr "Les domaines désactivés sont exclus de la vérification : {', '.join(excluded_domains)}"
|
msgstr "Les domaines désactivés sont exclus de la récupération : %(domains)s"
|
||||||
|
|
||||||
#: build/lib/mailbox_manager/apps.py:11 mailbox_manager/apps.py:11
|
#: build/lib/mailbox_manager/apps.py:11 mailbox_manager/apps.py:11
|
||||||
msgid "Mailbox manager"
|
msgid "Mailbox manager"
|
||||||
|
|||||||
@@ -32,22 +32,22 @@ def sync_mailboxes_from_dimail(modeladmin, request, queryset): # pylint: disabl
|
|||||||
except exceptions.HTTPError as err:
|
except exceptions.HTTPError as err:
|
||||||
messages.error(
|
messages.error(
|
||||||
request,
|
request,
|
||||||
_(f"Synchronisation failed for {domain.name} with message: [{err}]"),
|
_("Synchronisation failed for %(domain)s with message: %(err)s")
|
||||||
|
% {"domain": domain.name, "err": err},
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_(
|
_(
|
||||||
f"Synchronisation succeed for {domain.name}. "
|
"Synchronisation succeed for %(domain)s. Imported mailboxes: %(mailboxes)s"
|
||||||
f"Imported mailboxes: {', '.join(imported_mailboxes)}"
|
)
|
||||||
),
|
% {"domain": domain.name, "mailboxes": ", ".join(imported_mailboxes)},
|
||||||
)
|
)
|
||||||
if excluded_domains:
|
if excluded_domains:
|
||||||
messages.warning(
|
messages.warning(
|
||||||
request,
|
request,
|
||||||
_(
|
_("Sync require enabled domains. Excluded domains: %(domains)s")
|
||||||
f"Sync require enabled domains. Excluded domains: {', '.join(excluded_domains)}"
|
% {"domains": ", ".join(excluded_domains)},
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +67,10 @@ def fetch_domain_status_from_dimail(modeladmin, request, queryset): # pylint: d
|
|||||||
try:
|
try:
|
||||||
response = client.fetch_domain_status(domain)
|
response = client.fetch_domain_status(domain)
|
||||||
except exceptions.HTTPError as err:
|
except exceptions.HTTPError as err:
|
||||||
msg_error.append(_(f"- {domain.name} with message: '{err}'"))
|
msg_error.append(
|
||||||
|
_("- %(domain)s with message: %(err)s")
|
||||||
|
% {"domain": domain.name, "err": err},
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
success = True
|
success = True
|
||||||
# temporary (or not?) display content of the dimail response to debug broken state
|
# temporary (or not?) display content of the dimail response to debug broken state
|
||||||
@@ -79,7 +82,7 @@ def fetch_domain_status_from_dimail(modeladmin, request, queryset): # pylint: d
|
|||||||
if success:
|
if success:
|
||||||
msg_success = [
|
msg_success = [
|
||||||
_("Check domains done with success."),
|
_("Check domains done with success."),
|
||||||
_(f"Domains updated: {', '.join(domains_updated)}")
|
_("Domains updated: %(domains)s") % {"domains": ", ".join(domains_updated)}
|
||||||
if domains_updated
|
if domains_updated
|
||||||
else _("No domain updated."),
|
else _("No domain updated."),
|
||||||
]
|
]
|
||||||
@@ -96,9 +99,8 @@ def fetch_domain_status_from_dimail(modeladmin, request, queryset): # pylint: d
|
|||||||
if excluded_domains:
|
if excluded_domains:
|
||||||
messages.warning(
|
messages.warning(
|
||||||
request,
|
request,
|
||||||
_(
|
_("Domains disabled are excluded from check: %(domains)s")
|
||||||
f"Domains disabled are excluded from check: {', '.join(excluded_domains)}"
|
% {"domains": ", ".join(excluded_domains)},
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -116,18 +118,20 @@ def fetch_domain_expected_config_from_dimail(modeladmin, request, queryset): #
|
|||||||
if response:
|
if response:
|
||||||
messages.success(
|
messages.success(
|
||||||
request,
|
request,
|
||||||
_(f"Domain expected config fetched with success for {domain.name}."),
|
_("Domain expected config fetched with success for %(domain)s.")
|
||||||
|
% {"domain": domain.name},
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
messages.error(
|
messages.error(
|
||||||
request, _(f"Failed to fetch domain expected config for {domain.name}.")
|
request,
|
||||||
|
_("Failed to fetch domain expected config for %(domain)s.")
|
||||||
|
% {"domain": domain.name},
|
||||||
)
|
)
|
||||||
if excluded_domains:
|
if excluded_domains:
|
||||||
messages.warning(
|
messages.warning(
|
||||||
request,
|
request,
|
||||||
_(
|
_("Domains disabled are excluded from fetch: %(domains)s")
|
||||||
f"Domains disabled are excluded from fetch: {', '.join(excluded_domains)}"
|
% {"domains": ", ".join(excluded_domains)},
|
||||||
),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user