Made new string translatable

This commit is contained in:
Frisk 2021-05-17 23:37:53 +02:00
parent d481e397df
commit bb2e684a8a
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -815,7 +815,7 @@ def get_changed_groups(change: dict, separator: str) -> [str, str]:
"""Creates strings comparing the changes between the user groups for the user""" """Creates strings comparing the changes between the user groups for the user"""
def expiry_parse_time(passed_time): def expiry_parse_time(passed_time):
try: try:
return " (until " + datetime.datetime.strptime(passed_time, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S UTC") + ")" return _(" (until {date_and_time})").format(date_and_time=datetime.datetime.strptime(passed_time, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S UTC"))
except ValueError: except ValueError:
return "" return ""
new_group_meta = {_(t["group"]): expiry_parse_time(t.get("expiry", "infinity")) for t in change["logparams"].get("newmetadata", [])} new_group_meta = {_(t["group"]): expiry_parse_time(t.get("expiry", "infinity")) for t in change["logparams"].get("newmetadata", [])}