1
1
<script >
2
2
import { addDays , addMonths } from ' date-fns'
3
- import currencyFormtter from ' currency-formatter'
3
+ import currencyFormatter from ' currency-formatter'
4
4
import { mapState } from ' vuex'
5
5
6
6
import axios from ' axios'
@@ -14,12 +14,12 @@ export default {
14
14
data : function () {
15
15
return {
16
16
dateRangeOptions: [
17
- { label: ' This week ' , value: ' this_week' },
18
- { label: ' This month ' , value: ' this_month' },
19
- { label: ' Past 30 days ' , value: ' past_30_days' },
20
- { label: ' Past 3 months ' , value: ' past_3_months' },
21
- { label: ' This year ' , value: ' this_year' },
22
- { label: ' All Time ' , value: ' all_time' },
17
+ { label: this . $t ( ' thisweek ' ) , value: ' this_week' },
18
+ { label: this . $t ( ' thismonth ' ) , value: ' this_month' },
19
+ { label: this . $tc ( ' pastxdays ' , 30 ) , value: ' past_30_days' },
20
+ { label: this . $tc ( ' pastxmonths ' , 3 ) , value: ' past_3_months' },
21
+ { label: this . $t ( ' thisyear ' ) , value: ' this_year' },
22
+ { label: this . $t ( ' alltime ' ) , value: ' all_time' },
23
23
],
24
24
dateRangeOption: ' past_30_days' ,
25
25
stats: [],
@@ -32,15 +32,15 @@ export default {
32
32
return [
33
33
[
34
34
{
35
- label: ' Total Expenditure ' ,
35
+ label: this . $t ( ' totalexpenses ' ) ,
36
36
value: this .formatCurrency (0 , this .user .currency ),
37
37
},
38
38
{
39
- label: ' Fillup Costs ' ,
39
+ label: this . $t ( ' fillupcost ' ) ,
40
40
value: ` ${ this .formatCurrency (0 , this .user .currency )} (0)` ,
41
41
},
42
42
{
43
- label: ' Other Expenses ' ,
43
+ label: this . $t ( ' otherexpenses ' ) ,
44
44
value: ` ${ this .formatCurrency (0 , this .user .currency )} (0)` ,
45
45
},
46
46
],
@@ -49,15 +49,15 @@ export default {
49
49
return this .stats .map ((x ) => {
50
50
return [
51
51
{
52
- label: ' Total Expenditure ' ,
52
+ label: this . $t ( ' totalexpenses ' ) ,
53
53
value: this .formatCurrency (x .expenditureTotal , x .currency ),
54
54
},
55
55
{
56
- label: ' Fillup Costs ' ,
56
+ label: this . $t ( ' fillupcost ' ) ,
57
57
value: ` ${ this .formatCurrency (x .expenditureFillups , x .currency )} (${ x .countFillups } )` ,
58
58
},
59
59
{
60
- label: ' Other Expenses ' ,
60
+ label: this . $t ( ' otherexpenses ' ) ,
61
61
value: ` ${ this .formatCurrency (x .expenditureExpenses , x .currency )} (${ x .countExpenses } )` ,
62
62
},
63
63
]
@@ -80,7 +80,7 @@ export default {
80
80
if (! currencyCode) {
81
81
currencyCode = this .me .currency
82
82
}
83
- return currencyFormtter .format (number, { code: currencyCode })
83
+ return currencyFormatter .format (number, { code: currencyCode })
84
84
},
85
85
getStats () {
86
86
axios
@@ -129,7 +129,7 @@ export default {
129
129
<template >
130
130
<div >
131
131
<div class =" columns" >
132
- <div class =" column" :class =" isMobile ? 'has-text-centered' : ''" > <h1 class =" title" >Stats </h1 ></div >
132
+ <div class =" column" :class =" isMobile ? 'has-text-centered' : ''" > <h1 class =" title" >{{ $t('statistics') }} </h1 ></div >
133
133
<div class =" column" >
134
134
<b-select v-model =" dateRangeOption" class =" is-pulled-right is-medium" >
135
135
<option v-for =" option in dateRangeOptions" :key =" option.value" :value =" option.value" >
0 commit comments