@@ -17,7 +17,6 @@ import moment from "moment";
17
17
import utils from "../../../lib/common/utils" ;
18
18
import CreditOfferActions , {
19
19
FEE_RATE_DENOM ,
20
- listRepayPeriod ,
21
20
parsingTime
22
21
} from "../../../actions/CreditOfferActions" ;
23
22
@@ -31,6 +30,7 @@ import Translate from "react-translate-component";
31
30
import FeeAssetSelector from "../../Utility/FeeAssetSelector" ;
32
31
import { checkBalance } from "common/trxHelper" ;
33
32
import notify from "actions/NotificationActions" ;
33
+ import IntlStore from "stores/IntlStore" ;
34
34
35
35
const getUninitializedFeeAmount = ( ) =>
36
36
new Asset ( { amount : 0 , asset_id : "1.3.0" } ) ;
@@ -150,15 +150,9 @@ class CreditOfferPage extends React.Component {
150
150
return aAsset - bAsset ;
151
151
}
152
152
153
- _getUnits ( ) {
154
- return [
155
- counterpart . translate ( "credit_offer.uint_day" ) ,
156
- counterpart . translate ( "credit_offer.uint_hour" ) ,
157
- counterpart . translate ( "credit_offer.uint_minute" )
158
- ] ;
159
- }
160
-
161
153
_getColumns ( ) {
154
+ let { locale} = this . props ;
155
+ if ( locale === "zh" ) locale = "zh_CN" ;
162
156
return [
163
157
{
164
158
title : "ID" ,
@@ -253,7 +247,7 @@ class CreditOfferPage extends React.Component {
253
247
sorter : ( a , b ) =>
254
248
a . max_duration_seconds - b . max_duration_seconds ,
255
249
render : item => {
256
- return parsingTime ( item , this . _getUnits ( ) ) ;
250
+ return parsingTime ( item , locale ) ;
257
251
}
258
252
} ,
259
253
{
@@ -583,7 +577,7 @@ class CreditOfferPage extends React.Component {
583
577
>
584
578
{ parsingTime (
585
579
info . max_duration_seconds ,
586
- this . _getUnits ( )
580
+ this . props . locale
587
581
) }
588
582
</ div >
589
583
</ Form . Item >
@@ -716,13 +710,14 @@ class CreditOfferPage extends React.Component {
716
710
717
711
CreditOfferPage = connect ( CreditOfferPage , {
718
712
listenTo ( ) {
719
- return [ AccountStore , CreditOfferStore ] ;
713
+ return [ AccountStore , CreditOfferStore , IntlStore ] ;
720
714
} ,
721
715
getProps ( props ) {
722
716
return {
723
717
currentAccount : AccountStore . getState ( ) . currentAccount ,
724
718
passwordAccount : AccountStore . getState ( ) . passwordAccount ,
725
- allList : CreditOfferStore . getState ( ) . allList
719
+ allList : CreditOfferStore . getState ( ) . allList ,
720
+ locale : IntlStore . getState ( ) . currentLocale
726
721
} ;
727
722
}
728
723
} ) ;
0 commit comments