Skip to content

Commit bbdcdc7

Browse files
committed
fix: update localization strings for alias prompts and warnings
1 parent 632afa2 commit bbdcdc7

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

l10n/bundle.l10n.zh-cn.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Please enter new alias": "请输入新的别名,例如:alias nv='node -v'",
2+
"Please enter new alias. e.g. nv='node -v'": "请输入新的别名,例如:nv='node -v'",
33
"Please enter new alias name": "请输入新的别名名称",
44
"Please enter new alias command": "请输入新的指令名称",
55
"Please enter new description": "请输入新的备注",
@@ -9,14 +9,15 @@
99
"Alias name is mandatory to execute this action": "别名名称不能为空",
1010
"Alias command is mandatory to execute this action": "指令名称不能为空",
1111
"No alias": "没有任何别名",
12+
"No alias can be deleted": "没有可以删除的别名",
1213
"Alias has been added to the clipboard Successfully": "别名已成功复制到剪贴板",
1314
"Please enter new group": "请输入新的组名",
1415
"Group is mandatory to execute this action": "组不能为空",
1516
"Duplicate group": "组名称重复",
1617
"Please choose a group to add": "请选择一个组添加别名",
1718
"frequency: {frequency}": "运行次数: {frequency}",
1819
"No any group can be added": "没有可以添加的组",
19-
"Are you sure to delete all alias?": "确认删除所有的别名吗?",
20+
"Are you sure to delete all aliases?": "确认删除所有的别名吗?",
2021
"Confirm": "确认",
2122
"The .zshrc file on {path} doesn't exist. Do you want to create .zshrc file in this path?": "{path} 下.zshrc文件不存在,你想创建此文件吗?",
2223
"Create .zshrc file on {path} successfully": "{path} 下.zshrc文件创建成功",

src/extension.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ class AliasView implements vscode.TreeDataProvider<AliasItem> {
335335

336336
async addAlias() {
337337
const alias = await vscode.window.showInputBox({
338-
placeHolder: vscode.l10n.t(`Please enter new alias. e.g. alias nv='node -v'`),
338+
placeHolder: vscode.l10n.t(`Please enter new alias. e.g. nv='node -v'`),
339339
value: undefined,
340340
})
341341

@@ -382,8 +382,14 @@ alias ${alias}`,
382382
}
383383

384384
async deleteAllAlias() {
385+
const aliases = getAliases(storePath.path)
386+
if (!aliases.length) {
387+
vscode.window.showWarningMessage(vscode.l10n.t('No alias can be deleted'))
388+
return
389+
}
390+
385391
const text = await vscode.window.showInformationMessage(
386-
vscode.l10n.t('Are you sure to delete all alias?'),
392+
vscode.l10n.t('Are you sure to delete all aliases?'),
387393
{ modal: true },
388394
vscode.l10n.t('Confirm'),
389395
)
@@ -392,11 +398,6 @@ alias ${alias}`,
392398
return
393399
}
394400

395-
const aliases = getAliases(storePath.path)
396-
if (!aliases.length) {
397-
return
398-
}
399-
400401
executeCommandInTerminal(formatUnaliasCommand(aliases))
401402

402403
deleteAliases(storePath.path)

0 commit comments

Comments
 (0)