-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
216 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
{ | ||
"pinned-files": "📌 Pinned Files", | ||
"welcome": "An extension that allows you to pin up some frequently opened files to here. \n Right click your files, and go for \"📌Pin Up\"! \n [Learn More](https://github.com/SaekiRaku/vscode-pin-up)", | ||
"pinned-files": "📌 Pinned Files", | ||
|
||
"pin-up": "📌 Pin Up", | ||
"pin-up-outside": "📌 Pin Up (From outside files)", | ||
"remove": "Remove", | ||
"remove-all": "Remove All" | ||
"remove-pin": "Remove Pin", | ||
"remove-all": "Remove All", | ||
|
||
"fs-create-file": "New File", | ||
"fs-create-folder": "New Folder", | ||
"fs-delete": "Delete to Trash" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
{ | ||
"pinned-files": "📌 已固定文件", | ||
"welcome": "该扩展可以将一些经常打开的文件固定到此处。\n 右键单击文件然后选择 \"📌 固定\"! \n [了解更多](https://github.com/SaekiRaku/vscode-pin-up)", | ||
"pinned-files": "📌 已固定文件", | ||
|
||
"pin-up": "📌 固定", | ||
"pin-up-outside": "📌 固定外部文件", | ||
"remove": "移除", | ||
"remove-all": "移除全部" | ||
"remove-pin": "移除固定", | ||
"remove-all": "移除全部", | ||
|
||
"fs-create-file": "新建文件", | ||
"fs-create-folder": "新建目录", | ||
"fs-delete": "删除到回收站" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const translate = { | ||
"en": { | ||
"yes": "Yes", | ||
"no": "No", | ||
"input-file-name": "Please input file name", | ||
"input-folder-name": "Please input folder name", | ||
"file-exists": "Directory/File is already exists, do you want to overwrite it?" | ||
}, | ||
"zh": { | ||
"yes": "是", | ||
"no": "否", | ||
"input-file-name": "请输入文件名", | ||
"input-folder-name": "请输入目录名", | ||
"file-exists": "文件或目录已存在,是否覆盖?" | ||
} | ||
} | ||
|
||
module.exports = function (message) { | ||
let locale = JSON.parse(process.env.VSCODE_NLS_CONFIG).locale; | ||
if (locale.indexOf("zh") == 0) { | ||
locale = "zh" | ||
} | ||
let t = translate[locale] || translate["en"]; | ||
return t[message] || message; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
const os = require("os"); | ||
const vscode = require('vscode'); | ||
const i18n = require("./i18n.runtime.js"); | ||
|
||
exports.fixedPath = function(thepath){ | ||
if(os.type() == "Windows_NT"){ | ||
if(thepath[0]==="/"){ | ||
exports.fixedPath = function (thepath) { | ||
if (os.type() == "Windows_NT") { | ||
if (thepath[0] === "/") { | ||
return thepath.slice(1, thepath.length); | ||
} | ||
} | ||
return thepath; | ||
} | ||
|
||
exports.uiConfirm = async function (title) { | ||
let YES = i18n("yes"); | ||
let NO = i18n("no"); | ||
let quickpick = vscode.window.createQuickPick(); | ||
quickpick.title = title; | ||
quickpick.items = [{ | ||
label: YES | ||
}, { | ||
label: NO | ||
}]; | ||
|
||
quickpick.show(); | ||
|
||
let pick = await new Promise((resolve, reject) => { | ||
let select = ""; | ||
|
||
quickpick.onDidChangeSelection((evt) => { | ||
select = evt[0].label; | ||
}); | ||
|
||
quickpick.onDidAccept((evt) => { | ||
quickpick.hide(); | ||
resolve(select); | ||
}) | ||
}) | ||
|
||
quickpick.dispose(); | ||
|
||
if (!pick || pick === NO) { | ||
return false; | ||
} | ||
return true; | ||
} |