Skip to content

Commit 08834dd

Browse files
committed
🐞 fix: revise the translation
1 parent 2481a6f commit 08834dd

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/chili-ui/src/viewport/okCancel.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// See LICENSE file in the project root for full license information.
33

44
import { div, span, svg } from "chili-controls";
5-
import { AsyncController, I18n } from "chili-core";
5+
import { AsyncController, I18nKeys, Localize } from "chili-core";
66
import style from "./okCancel.module.css";
77

88
export class OKCancel extends HTMLElement {
@@ -17,7 +17,7 @@ export class OKCancel extends HTMLElement {
1717
private container() {
1818
return div(
1919
{ className: style.container },
20-
span({ textContent: I18n.translate("ribbon.group.selection") }),
20+
span({ textContent: new Localize("ribbon.group.selection") }),
2121
div({ className: style.spacer }),
2222
this.buttons(),
2323
);
@@ -26,13 +26,20 @@ export class OKCancel extends HTMLElement {
2626
private buttons() {
2727
return div(
2828
{ 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),
3131
);
3232
}
3333

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+
);
3643
}
3744

3845
setControl(control: AsyncController | undefined) {

0 commit comments

Comments
 (0)