Skip to content

Commit

Permalink
feat: 实现剪切粘贴的国际化部分,忽略自动生成的类型定义文件
Browse files Browse the repository at this point in the history
  • Loading branch information
rxliuli committed May 19, 2021
1 parent 71f93d4 commit bb1d3f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 45 deletions.
3 changes: 2 additions & 1 deletion apps/joplin-vscode-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ yarn-error.log
dist
.cache
*.tgz
.vscode/launch.json
.vscode/launch.json
src/i18n/index.d.ts
5 changes: 4 additions & 1 deletion apps/joplin-vscode-plugin/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"file uploaded successfully": "file uploaded successfully",
"No active editor": "No active editor",
"Resource [{{title}}] does not exist": "Resource [{{title}}] does not exist",
"Resource does not exist": "Resource does not exist"
"Resource does not exist": "Resource does not exist",
"cut-success": "Cut successfully",
"paste-success": "Paste successfully",
"paste-error-canTPasteSub": "Can't paste into a subdirectory"
}
40 changes: 0 additions & 40 deletions apps/joplin-vscode-plugin/src/i18n/index.d.ts

This file was deleted.

5 changes: 4 additions & 1 deletion apps/joplin-vscode-plugin/src/i18n/zhCN.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
"Clipboard does not contain picture!": "剪贴板不包含图片",
"file uploaded successfully": "文件上传成功",
"No active editor": "当前没有激活的编辑器",
"Resource does not exist": "资源不存在"
"Resource does not exist": "资源不存在",
"cut-success": "剪切成功",
"paste-success": "粘贴成功",
"paste-error-canTPasteSub": "不能粘贴到子目录中"
}
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ export class JoplinNoteCommandService {
cut(item: FolderOrNote = this.config.noteListTreeView.selection[0]) {
console.log('joplinNote.cut: ', item)
this.clipboard = item
vscode.window.showInformationMessage(i18n.t('cut-success'))
}

/**
Expand All @@ -461,15 +462,15 @@ export class JoplinNoteCommandService {
const paths = await folderExtApi.path(item.id)
console.log('paths: ', paths)
if (paths.some((item) => item.id === clipboard.id)) {
console.log('不能移动到子目录')
vscode.window.showWarningMessage(i18n.t('paste-error-canTPasteSub'))
return
}
await folderExtApi.move(clipboard.id, item.id)
} else {
await noteExtApi.move(clipboard.id, item.id)
}
await this.config.noteViewProvider.refresh()
console.log('粘贴完成')
vscode.window.showInformationMessage(i18n.t('paste-success'))
this.clipboard = null
}
}

0 comments on commit bb1d3f2

Please sign in to comment.