fix: add translate function to strings

This commit is contained in:
Ernesto Ruiz 2022-09-19 11:55:13 -06:00 committed by GitHub
parent 9decebe6e1
commit aa49ec815a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,7 @@ def get_chart_based_on_status(data):
for d in data:
status_wise_data[d.status] += 1
labels = [_(label) for label in labels]
values = [status_wise_data[label] for label in labels]
chart = {
@ -95,7 +96,7 @@ def get_chart_based_on_status(data):
def get_chart_based_on_age(data):
labels = ["0-30 Days", "30-60 Days", "60-90 Days", "90 Above"]
labels = [_("0-30 Days"), _("30-60 Days"), _("60-90 Days"), _("90 Above")]
age_wise_data = {"0-30 Days": 0, "30-60 Days": 0, "60-90 Days": 0, "90 Above": 0}
@ -135,8 +136,8 @@ def get_chart_based_on_qty(data, filters):
pending.append(periodic_data.get("Pending").get(d))
completed.append(periodic_data.get("Completed").get(d))
datasets.append({"name": "Pending", "values": pending})
datasets.append({"name": "Completed", "values": completed})
datasets.append({"name": _("Pending"), "values": pending})
datasets.append({"name": _("Completed"), "values": completed})
chart = {
"data": {"labels": labels, "datasets": datasets},