Merge branch 'feature/french' into 'master'
feature: texts translated in French See merge request djangoldp-packages/djangoldp-notification!24
This commit is contained in:
commit
1c7ec32288
@ -82,7 +82,7 @@ def send_notification(sender, instance, created, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def send_request(target, object_iri, instance, created):
|
def send_request(target, object_iri, instance, created):
|
||||||
unknown = _("Unknown author")
|
unknown = _("Auteur inconnu")
|
||||||
author = getattr(getattr(instance, MODEL_MODIFICATION_USER_FIELD, unknown), "urlid", unknown)
|
author = getattr(getattr(instance, MODEL_MODIFICATION_USER_FIELD, unknown), "urlid", unknown)
|
||||||
request_type = "creation" if created else "update"
|
request_type = "creation" if created else "update"
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
|
|||||||
else:
|
else:
|
||||||
who = requests.get(instance.author).json()['name']
|
who = requests.get(instance.author).json()['name']
|
||||||
except:
|
except:
|
||||||
who = "Unknown Person"
|
who = "Personne inconnue"
|
||||||
|
|
||||||
# get identifier for resource triggering notification, and store in where
|
# get identifier for resource triggering notification, and store in where
|
||||||
try:
|
try:
|
||||||
@ -126,12 +126,12 @@ def send_email_on_notification(sender, instance, created, **kwargs):
|
|||||||
else:
|
else:
|
||||||
where = requests.get(instance.object).json()['name']
|
where = requests.get(instance.object).json()['name']
|
||||||
except:
|
except:
|
||||||
where = "Unknown place"
|
where = "Endroit inconnu"
|
||||||
|
|
||||||
if who == where:
|
if who == where:
|
||||||
where = "has sent you a private message"
|
where = "t'a envoyé un message privé"
|
||||||
else:
|
else:
|
||||||
where = "mentioned you on " + where
|
where = "t'a mentionné sur " + where
|
||||||
|
|
||||||
html_message = loader.render_to_string(
|
html_message = loader.render_to_string(
|
||||||
'email.html',
|
'email.html',
|
||||||
@ -144,7 +144,7 @@ def send_email_on_notification(sender, instance, created, **kwargs):
|
|||||||
)
|
)
|
||||||
|
|
||||||
send_mail(
|
send_mail(
|
||||||
'Notification on ' + (settings.INSTANCE_DEFAULT_CLIENT or settings.JABBER_DEFAULT_HOST),
|
'Notification sur ' + (settings.INSTANCE_DEFAULT_CLIENT or settings.JABBER_DEFAULT_HOST),
|
||||||
instance.summary,
|
instance.summary,
|
||||||
settings.EMAIL_HOST_USER or "noreply@" + settings.JABBER_DEFAULT_HOST,
|
settings.EMAIL_HOST_USER or "noreply@" + settings.JABBER_DEFAULT_HOST,
|
||||||
[instance.user.email],
|
[instance.user.email],
|
||||||
|
@ -4,16 +4,16 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
<p style='font-style:italic;color:#777'><b>{{ author }}</b> {{ object }} from on {{ on }}</p>
|
<p style='font-style:italic;color:#777'><b>{{ author }}</b> {{ object }} de {{ on }}</p>
|
||||||
<p>{{ instance.summary }}</p>
|
<p>{{ instance.summary }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div style='margin-top:10px;'>
|
<div style='margin-top:10px;'>
|
||||||
<p style='font-size:small;color:#777'>
|
<p style='font-size:small;color:#777'>
|
||||||
--
|
--
|
||||||
<br>
|
<br>
|
||||||
Do not reply to this email directly, go to <a href='{{ on }}' target='_blank'>{{ on }}</a> instead.
|
Ne réponds pas directement à cet e-mail, à la place rends-toi sur <a href='{{ on }}' target='_blank'>{{ on }}</a>.
|
||||||
<br>
|
<br>
|
||||||
<a href='#'>Unsubscribe</a>
|
<a href='#'>Se désinscrire</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user