Skip to content

Commit 9842f55

Browse files
committed
[IMP] awesome_dashboard: add translations to text
1 parent 0df9683 commit 9842f55

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

awesome_dashboard/static/src/dashboard/dashboard_items.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,67 @@
11
import { NumberCard } from "./number_card";
22
import { registry } from "@web/core/registry";
33
import { PieChartCard } from "./pie_chart_card";
4+
import { _t } from "@web/core/l10n/translation";
5+
46

57
const items = [
68
{
79
id: "average_quantity",
8-
description: "Average amount of t-shirt",
10+
description: _t("Average amount of t-shirt"),
911
Component: NumberCard,
1012
size: 1,
1113
props: (data) => ({
12-
title: "Average amount of t-shirt by order this month",
14+
title: _t("Average amount of t-shirt by order this month"),
1315
value: data.average_quantity
1416
})
1517
},
1618
{
1719
id: "average_time",
18-
description: "Average time for orders",
20+
description: _t("Average time for orders"),
1921
Component: NumberCard,
2022
size: 1,
2123
props: (data) => ({
22-
title: "Average time for an order to go from 'new' to 'sent' or 'cancelled'",
24+
title: _t("Average time for an order to go from 'new' to 'sent' or 'cancelled'"),
2325
value: data.average_time
2426
})
2527
},
2628
{
2729
id: "nb_new_orders",
28-
description: "Number of new orders",
30+
description: _t("Number of new orders"),
2931
Component: NumberCard,
3032
size: 1,
3133
props: (data) => ({
32-
title: "Number of new orders this month",
34+
title: _t("Number of new orders this month"),
3335
value: data.nb_new_orders
3436
})
3537
},
3638
{
3739
id: "nb_cancelled_orders",
38-
description: "Number of cancelled orders",
40+
description: _t("Number of cancelled orders"),
3941
Component: NumberCard,
4042
size: 1,
4143
props: (data) => ({
42-
title: "Number of cancelled orders this month",
44+
title: _t("Number of cancelled orders this month"),
4345
value: data.nb_cancelled_orders
4446
})
4547
},
4648
{
4749
id: "total_amount",
48-
description: "Total amount of new orders",
50+
description: _t("Total amount of new orders"),
4951
Component: NumberCard,
5052
size: 1,
5153
props: (data) => ({
52-
title: "Total amount of new orders this month",
54+
title: _t("Total amount of new orders this month"),
5355
value: data.total_amount
5456
})
5557
},
5658
{
5759
id: "orders_by_size",
58-
description: "Shirt orders by size",
60+
description: _t("Shirt orders by size"),
5961
Component: PieChartCard,
6062
size: 2,
6163
props: (data) => ({
62-
title: "Shirt orders by size",
64+
title: _t("Shirt orders by size"),
6365
value: data.orders_by_size
6466
})
6567
},

awesome_dashboard/static/src/dashboard/pie_chart/pie_chart.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class PieChart extends Component {
2020
const dataset = {
2121
labels: Object.keys(this.props.data),
2222
datasets: [{
23-
label: 'T-Shirt Size Distribution',
2423
data: Object.values(this.props.data)
2524
}]
2625
}

0 commit comments

Comments
 (0)