Skip to content

Commit affd444

Browse files
author
pipeline
committed
feature(EJ2-1928): NumericTextBox sample intl changes have been committed.
1 parent 05a1c90 commit affd444

File tree

2 files changed

+18
-30
lines changed

2 files changed

+18
-30
lines changed

src/numerictextbox/internationalization.component.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
import { Component, ViewChild } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { loadCldr, L10n } from '@syncfusion/ej2-base';
3-
import { NumericTextBoxComponent } from '@syncfusion/ej2-ng-inputs';
43

54
@Component({
65
selector: 'control-content',
76
templateUrl: 'internationalization.html',
87
})
98
export class InternationalizationController {
10-
@ViewChild('numeric')
11-
public numeric: NumericTextBoxComponent;
12-
@ViewChild('percentage')
13-
public percentage: NumericTextBoxComponent;
14-
@ViewChild('currencyTextBox')
15-
public currencyTextBox: NumericTextBoxComponent;
169
locale: string = 'de';
1710
currency: string = 'EUR';
1811
numericValue: number = 10;
@@ -25,17 +18,20 @@ export class InternationalizationController {
2518
L10n.load({
2619
'en': {
2720
'numerictextbox': {
28-
incrementTitle: 'Increment value', decrementTitle: 'Decrement value'
21+
incrementTitle: 'Increment value', decrementTitle: 'Decrement value',
22+
placeholder: 'Enter the value'
2923
}
3024
},
3125
'de': {
3226
'numerictextbox': {
33-
incrementTitle: 'Wert erhöhen', decrementTitle: 'Dekrementwert'
27+
incrementTitle: 'Wert erhöhen', decrementTitle: 'Dekrementwert',
28+
placeholder: 'Geben Sie den Wert ein'
3429
}
3530
},
3631
'zh': {
3732
'numerictextbox': {
38-
incrementTitle: '增值', decrementTitle: '遞減值'
33+
incrementTitle: '增值', decrementTitle: '遞減值',
34+
placeholder: '輸入值'
3935
}
4036
}
4137
});
@@ -53,19 +49,10 @@ export class InternationalizationController {
5349
this.locale = culture;
5450
if (culture === 'zh') {
5551
this.currency = 'CNY';
56-
this.numeric.placeholder = '输入值';
57-
this.currencyTextBox.placeholder = '输入货币';
58-
this.percentage.placeholder = '输入百分比';
5952
} else if (culture === 'de') {
6053
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';
6454
} else {
6555
this.currency = 'USD';
66-
this.numeric.placeholder = 'Enter the value';
67-
this.currencyTextBox.placeholder = 'Enter the currency';
68-
this.percentage.placeholder = 'Enter the percentage';
6956
}
7057
}
7158
constructor() { }

src/numerictextbox/internationalization.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
<div class="control-section">
22
<div class="col-lg-8 content-wrapper">
33
<div class="content">
4-
<div class="wrapper">
5-
<ej-numerictextbox #numeric [value]="numericValue" placeholder="Geben Sie den Wert ein" [locale]="locale" ></ej-numerictextbox>
4+
<div class="wrapper">
5+
<ej-numerictextbox [locale]="locale" [value]="numericValue"></ej-numerictextbox>
66
</div>
7-
<div class="wrapper">
8-
<ej-numerictextbox #percentage format="p2" placeholder="Geben Sie den Prozentsatz ein" [value]="percentValue" [min]="min" [max]="max" [step]="step" [locale]="locale"></ej-numerictextbox>
7+
<div class="wrapper">
8+
<ej-numerictextbox format="p2" [locale]="locale" [value]="percentValue" [step]="step" [max]="max" [min]="min"></ej-numerictextbox>
99
</div>
10-
<div class='wrapper'>
11-
<ej-numerictextbox #currencyTextBox format="c2" placeholder="Geben Sie die Währung ein" [value]="currencyValue" [locale]="locale" [currency]="currency" ></ej-numerictextbox>
10+
<div class="wrapper">
11+
<ej-numerictextbox format="c2" [locale]="locale" [value]="currencyValue" [currency]="currency"></ej-numerictextbox>
1212
</div>
1313
</div>
1414
</div>
1515
<div class="col-lg-4 property-section">
1616
<div class="property-panel-section">
1717
<div class="property-panel-header">Properties</div>
1818
<div class="property-panel-content">
19-
<table id="property" class="property-panel-table" title="Properties">
20-
<tr>
19+
<table title="Properties" class="property-panel-table" id="property">
20+
<tbody><tr>
2121
<td>
2222
<div>Culture</div>
2323
</td>
2424
<td>
2525
<div>
26-
<select id="cultures" class="form-control" (change)="changeLocale()">
26+
<select class="form-control" id="cultures" (change)="changeLocale()">
2727
<option value="de">de</option>
2828
<option value="zh">zh</option>
2929
<option value="en">en</option>
3030
</select>
3131
</div>
3232
</td>
3333
</tr>
34-
</table>
34+
</tbody></table>
3535
</div>
3636
</div>
3737
</div>
3838
</div>
39+
3940
<div id="description">
4041
<p>
4142
The NumericTextBox comes with built-in internationalization support to adapt based on culture. You can change the culture of the component using ‘locale’ property, which format the currency symbol, decimal separator, and group separators.</p>

0 commit comments

Comments
 (0)