2
2
// See LICENSE file in the project root for full license information.
3
3
4
4
import { div , span , svg } from "chili-controls" ;
5
- import { AsyncController , I18n } from "chili-core" ;
5
+ import { AsyncController , I18nKeys , Localize } from "chili-core" ;
6
6
import style from "./okCancel.module.css" ;
7
7
8
8
export class OKCancel extends HTMLElement {
@@ -17,7 +17,7 @@ export class OKCancel extends HTMLElement {
17
17
private container ( ) {
18
18
return div (
19
19
{ className : style . container } ,
20
- span ( { textContent : I18n . translate ( "ribbon.group.selection" ) } ) ,
20
+ span ( { textContent : new Localize ( "ribbon.group.selection" ) } ) ,
21
21
div ( { className : style . spacer } ) ,
22
22
this . buttons ( ) ,
23
23
) ;
@@ -26,13 +26,20 @@ export class OKCancel extends HTMLElement {
26
26
private buttons ( ) {
27
27
return div (
28
28
{ className : style . panel } ,
29
- this . _createIcon ( "icon-confirm" , I18n . translate ( "common.confirm" ) , this . _onConfirm ) ,
30
- this . _createIcon ( "icon-cancel" , I18n . translate ( "common.cancel" ) , this . _onCancel ) ,
29
+ this . _createIcon ( "icon-confirm" , "common.confirm" , this . _onConfirm ) ,
30
+ this . _createIcon ( "icon-cancel" , "common.cancel" , this . _onCancel ) ,
31
31
) ;
32
32
}
33
33
34
- private _createIcon ( icon : string , text : string , onClick : ( ) => void ) {
35
- return div ( { className : style . icon , onclick : onClick } , svg ( { icon } ) , span ( { textContent : text } ) ) ;
34
+ private _createIcon ( icon : string , text : I18nKeys , onClick : ( ) => void ) {
35
+ return div (
36
+ {
37
+ className : style . icon ,
38
+ onclick : onClick ,
39
+ } ,
40
+ svg ( { icon } ) ,
41
+ span ( { textContent : new Localize ( text ) } ) ,
42
+ ) ;
36
43
}
37
44
38
45
setControl ( control : AsyncController | undefined ) {
0 commit comments