Skip to content

Commit d538c3b

Browse files
committed
refactor: optimize tooltip function
1 parent 3983171 commit d538c3b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

l10n/bundle.l10n.zh-cn.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"Group is mandatory to execute this action": "组不能为空",
1515
"Duplicate group": "组名称重复",
1616
"Please choose a group to add": "请选择一个组添加别名",
17-
"frequency": "运行次数",
17+
"frequency: {frequency}": "运行次数: {frequency}",
1818
"No any group can be added": "没有可以添加的组",
1919
"Are you sure to delete all alias?": "确认删除所有的别名吗?",
2020
"Confirm": "确认",

src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import {
1717
resolveAlias,
1818
} from './utils'
1919

20-
function setTooltip(frequency = 0) {
21-
return `${vscode.l10n.t('frequency')}: ${frequency}`
22-
}
23-
2420
export function activate(context: vscode.ExtensionContext) {
2521
// set default store path
2622
storePath.path = path.join(os.homedir(), '.zshrc')
@@ -137,6 +133,10 @@ function executeCommandInTerminal(command: string) {
137133
activeTerminal.sendText(command)
138134
}
139135

136+
function setTooltip(frequency = 0) {
137+
return vscode.l10n.t('frequency: {frequency}', { frequency })
138+
}
139+
140140
class AliasView implements vscode.TreeDataProvider<AliasItem> {
141141
private _onDidChangeTreeData: vscode.EventEmitter<AliasItem | undefined | null | undefined> = new vscode.EventEmitter<
142142
AliasItem | undefined | null | undefined

0 commit comments

Comments
 (0)