1
- import { Component } from '@angular/core' ;
1
+ import { Component , ViewChild } from '@angular/core' ;
2
2
import { loadCldr , L10n } from '@syncfusion/ej2-base' ;
3
+ import { NumericTextBoxComponent } from '@syncfusion/ej2-ng-inputs' ;
3
4
4
5
@Component ( {
5
6
selector : 'control-content' ,
6
7
templateUrl : 'internationalization.html' ,
7
8
} )
8
9
export class InternationalizationController {
10
+ @ViewChild ( 'numeric' )
11
+ public numeric : NumericTextBoxComponent ;
12
+ @ViewChild ( 'percentage' )
13
+ public percentage : NumericTextBoxComponent ;
14
+ @ViewChild ( 'currencyTextBox' )
15
+ public currencyTextBox : NumericTextBoxComponent ;
9
16
locale : string = 'de' ;
10
17
currency : string = 'EUR' ;
11
18
numericValue : number = 10 ;
@@ -18,20 +25,17 @@ export class InternationalizationController {
18
25
L10n . load ( {
19
26
'en' : {
20
27
'numerictextbox' : {
21
- incrementTitle : 'Increment value' , decrementTitle : 'Decrement value' ,
22
- placeholder : 'Enter the value'
28
+ incrementTitle : 'Increment value' , decrementTitle : 'Decrement value'
23
29
}
24
30
} ,
25
31
'de' : {
26
32
'numerictextbox' : {
27
- incrementTitle : 'Wert erhöhen' , decrementTitle : 'Dekrementwert' ,
28
- placeholder : 'Geben Sie den Wert ein'
33
+ incrementTitle : 'Wert erhöhen' , decrementTitle : 'Dekrementwert'
29
34
}
30
35
} ,
31
36
'zh' : {
32
37
'numerictextbox' : {
33
- incrementTitle : '增值' , decrementTitle : '遞減值' ,
34
- placeholder : '輸入值'
38
+ incrementTitle : '增值' , decrementTitle : '遞減值'
35
39
}
36
40
}
37
41
} ) ;
@@ -49,10 +53,19 @@ export class InternationalizationController {
49
53
this . locale = culture ;
50
54
if ( culture === 'zh' ) {
51
55
this . currency = 'CNY' ;
56
+ this . numeric . placeholder = '输入值' ;
57
+ this . currencyTextBox . placeholder = '输入货币' ;
58
+ this . percentage . placeholder = '输入百分比' ;
52
59
} else if ( culture === 'de' ) {
53
60
this . currency = 'EUR' ;
61
+ this . numeric . placeholder = 'Geben Sie den Wert ein' ;
62
+ this . currencyTextBox . placeholder = 'Geben Sie die Währung ein' ;
63
+ this . percentage . placeholder = 'Geben Sie den Prozentsatz ein' ;
54
64
} else {
55
65
this . currency = 'USD' ;
66
+ this . numeric . placeholder = 'Enter the value' ;
67
+ this . currencyTextBox . placeholder = 'Enter the currency' ;
68
+ this . percentage . placeholder = 'Enter the percentage' ;
56
69
}
57
70
}
58
71
constructor ( ) { }
0 commit comments