forked from CGM_Public/pretix_original
Fixed a wrong locale string
This commit is contained in:
@@ -37,10 +37,13 @@ class LazyI18nString:
|
|||||||
This will rather return you a string in a wrong language than give you an
|
This will rather return you a string in a wrong language than give you an
|
||||||
empty value.
|
empty value.
|
||||||
"""
|
"""
|
||||||
|
return self.localize(translation.get_language())
|
||||||
|
|
||||||
|
def localize(self, lng):
|
||||||
if self.data is None:
|
if self.data is None:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
if isinstance(self.data, dict):
|
if isinstance(self.data, dict):
|
||||||
lng = translation.get_language()
|
|
||||||
firstpart = lng.split('-')[0]
|
firstpart = lng.split('-')[0]
|
||||||
similar = [l for l in self.data.keys() if l.startswith(firstpart + "-")]
|
similar = [l for l in self.data.keys() if l.startswith(firstpart + "-")]
|
||||||
if lng in self.data and self.data[lng]:
|
if lng in self.data and self.data[lng]:
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ def mail(email: str, subject: str, template: str,
|
|||||||
|
|
||||||
body += "\r\n\r\n----\r\n"
|
body += "\r\n\r\n----\r\n"
|
||||||
body += _(
|
body += _(
|
||||||
"You are receiving this e-mail because you placed an order for %s." % event.name
|
"You are receiving this e-mail because you placed an order for {event}."
|
||||||
)
|
).format(event=event.name)
|
||||||
body += "\r\n"
|
body += "\r\n"
|
||||||
try:
|
try:
|
||||||
return mail_send([email], subject, body, sender, event.id if event else None)
|
return mail_send([email], subject, body, sender, event.id if event else None)
|
||||||
|
|||||||
Reference in New Issue
Block a user