feat: l10n support
This commit is contained in:
12
l10n/bundle.l10n.zh-CN.json
Normal file
12
l10n/bundle.l10n.zh-CN.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"Home": "主页",
|
||||||
|
"DevStar Home": "DevStar主页",
|
||||||
|
"Open": "打开主页",
|
||||||
|
"Miscellaneous": "杂项",
|
||||||
|
"Clean": "清理",
|
||||||
|
"User login successfully!":"用户已登录!",
|
||||||
|
"User has logged out!":"用户已登出!",
|
||||||
|
"Installing vscode-server and devstar extension in container": "正在容器中安装vscode-server及devstar插件",
|
||||||
|
"Connected! Start installation": "连接成功,开始安装",
|
||||||
|
"Installation completed!": "安装完成!"
|
||||||
|
}
|
67
package.json
67
package.json
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "devstar",
|
"name": "devstar",
|
||||||
|
"displayName": "%displayName%",
|
||||||
|
"description": "%description%",
|
||||||
"version": "0.2.12",
|
"version": "0.2.12",
|
||||||
|
"keywords": [],
|
||||||
"publisher": "mengning",
|
"publisher": "mengning",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.75.0"
|
"vscode": "^1.75.0"
|
||||||
},
|
},
|
||||||
|
"l10n": "./l10n",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"displayName": "DevStar",
|
|
||||||
"description": "",
|
|
||||||
"categories": [],
|
"categories": [],
|
||||||
"keywords": [],
|
|
||||||
"main": "./dist/extension",
|
"main": "./dist/extension",
|
||||||
"icon": "assets/images/devstar-logo.png",
|
"icon": "assets/images/devstar-logo.png",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@@ -28,12 +29,12 @@
|
|||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "devstar.showHome",
|
"command": "devstar.showHome",
|
||||||
"title": "DevStar Home",
|
"title": "%devstar.showHome.title%",
|
||||||
"category": "DevStar"
|
"category": "DevStar"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "devstar.connectRemoteContainer",
|
"command": "devstar.connectRemoteContainer",
|
||||||
"title": "Connect to a Remote Container",
|
"title": "%devstar.connectRemoteContainer.title%",
|
||||||
"category": "DevStar"
|
"category": "DevStar"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -41,6 +42,30 @@
|
|||||||
"protocol": "vscode",
|
"protocol": "vscode",
|
||||||
"path": "/openProject"
|
"path": "/openProject"
|
||||||
}],
|
}],
|
||||||
|
"views": {
|
||||||
|
"devstarListView": [
|
||||||
|
{
|
||||||
|
"id": "devstar.quickAccess",
|
||||||
|
"name": "%devstar.quickAccess.title%",
|
||||||
|
"type": "tree"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"viewsContainers": {
|
||||||
|
"activitybar": [
|
||||||
|
{
|
||||||
|
"id": "devstarListView",
|
||||||
|
"title": "%devstar.devstar.title%",
|
||||||
|
"icon": "assets/icons/devstar-activity-icon.svg"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"viewsWelcome": [
|
||||||
|
{
|
||||||
|
"view": "devstar.quickAccess",
|
||||||
|
"contents": "%devstar.welcome.title%"
|
||||||
|
}
|
||||||
|
],
|
||||||
"menus": {
|
"menus": {
|
||||||
"file/newFile": [
|
"file/newFile": [
|
||||||
{
|
{
|
||||||
@@ -50,38 +75,6 @@
|
|||||||
],
|
],
|
||||||
"touchBar": []
|
"touchBar": []
|
||||||
},
|
},
|
||||||
"viewsContainers": {
|
|
||||||
"activitybar": [
|
|
||||||
{
|
|
||||||
"id": "devstar",
|
|
||||||
"title": "DevStar",
|
|
||||||
"icon": "assets/icons/devstar-activity-icon.svg"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"views": {
|
|
||||||
"devstar": [
|
|
||||||
{
|
|
||||||
"id": "devstar.quickAccess",
|
|
||||||
"name": "Quick Access",
|
|
||||||
"type": "tree"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"viewsWelcome": [
|
|
||||||
{
|
|
||||||
"view": "devstar.quickAccess",
|
|
||||||
"contents": "welcome DevStar..."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"walkthroughs": [
|
|
||||||
{
|
|
||||||
"id": "devstar.welcome",
|
|
||||||
"title": "Get started with DevStar",
|
|
||||||
"description": "",
|
|
||||||
"steps": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "DevStar",
|
"title": "DevStar",
|
||||||
|
9
package.nls.json
Normal file
9
package.nls.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"displayName": "DevStar",
|
||||||
|
"discription": "",
|
||||||
|
"devstar.showHome.title": "DevStar Home",
|
||||||
|
"devstar.connectRemoteContainer.title": "Connect to a Remote Container",
|
||||||
|
"devstar.quickAccess.title": "Quick Access",
|
||||||
|
"devstar.devstar.title":"DevStar",
|
||||||
|
"devstar.welcome.title":"welcome DevStar..."
|
||||||
|
}
|
9
package.nls.zh-CN.json
Normal file
9
package.nls.zh-CN.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"displayName": "DevStar",
|
||||||
|
"discription": "DevStar",
|
||||||
|
"devstar.showHome.title": "显示主页",
|
||||||
|
"devstar.connectRemoteContainer.title": "连接容器",
|
||||||
|
"devstar.quickAccess.title": "快速访问",
|
||||||
|
"devstar.devstar.title":"DevStar",
|
||||||
|
"devstar.welcome.title":"欢迎使用DevStar..."
|
||||||
|
}
|
@@ -27,7 +27,7 @@ export default class DSHome {
|
|||||||
async toggle(devstarHomePageUrl: string = this.devstarHomePageUrl) {
|
async toggle(devstarHomePageUrl: string = this.devstarHomePageUrl) {
|
||||||
const panel = vscode.window.createWebviewPanel(
|
const panel = vscode.window.createWebviewPanel(
|
||||||
'homeWebview',
|
'homeWebview',
|
||||||
'Home',
|
vscode.l10n.t('Home'),
|
||||||
vscode.ViewColumn.One,
|
vscode.ViewColumn.One,
|
||||||
{
|
{
|
||||||
enableScripts: true,
|
enableScripts: true,
|
||||||
|
@@ -34,7 +34,7 @@ export default class RemoteContainer {
|
|||||||
const ssh = new NodeSSH();
|
const ssh = new NodeSSH();
|
||||||
vscode.window.withProgress({
|
vscode.window.withProgress({
|
||||||
location: vscode.ProgressLocation.Notification,
|
location: vscode.ProgressLocation.Notification,
|
||||||
title: "正在容器中安装vscode-server及devstar插件",
|
title: vscode.l10n.t("Installing vscode-server and devstar extension in container"),
|
||||||
cancellable: false
|
cancellable: false
|
||||||
}, async (progress) => {
|
}, async (progress) => {
|
||||||
try {
|
try {
|
||||||
@@ -46,7 +46,7 @@ export default class RemoteContainer {
|
|||||||
port: port,
|
port: port,
|
||||||
privateKeyPath: this.user.getUserPrivateKeyPath()
|
privateKeyPath: this.user.getUserPrivateKeyPath()
|
||||||
});
|
});
|
||||||
progress.report({ message: "连接成功,开始安装" });
|
progress.report({ message: vscode.l10n.t("Connected! Start installation")});
|
||||||
|
|
||||||
// install vscode-server and devstar extension
|
// install vscode-server and devstar extension
|
||||||
const vscodeCommitId = await utils.getVsCodeCommitId()
|
const vscodeCommitId = await utils.getVsCodeCommitId()
|
||||||
@@ -67,7 +67,7 @@ export default class RemoteContainer {
|
|||||||
`;
|
`;
|
||||||
await ssh.execCommand(installVscodeServerScript);
|
await ssh.execCommand(installVscodeServerScript);
|
||||||
console.log("vscode-server and extension installed");
|
console.log("vscode-server and extension installed");
|
||||||
vscode.window.showInformationMessage('安装完成!');
|
vscode.window.showInformationMessage(vscode.l10n.t('Installation completed!'));
|
||||||
}
|
}
|
||||||
|
|
||||||
await ssh.dispose();
|
await ssh.dispose();
|
||||||
|
@@ -58,7 +58,7 @@ export default class User {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vscode.window.showInformationMessage('用户已登录!')
|
vscode.window.showInformationMessage(vscode.l10n.t('User login successfully!'))
|
||||||
return 'ok'
|
return 'ok'
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -70,7 +70,7 @@ export default class User {
|
|||||||
public logout() {
|
public logout() {
|
||||||
this.setUserTokenToLocal("")
|
this.setUserTokenToLocal("")
|
||||||
this.setUsernameToLocal("")
|
this.setUsernameToLocal("")
|
||||||
vscode.window.showInformationMessage('用户已登出!')
|
vscode.window.showInformationMessage(vscode.l10n.t("User has logged out!"))
|
||||||
}
|
}
|
||||||
|
|
||||||
public isLogged() {
|
public isLogged() {
|
||||||
|
@@ -24,19 +24,19 @@ export default class QuickAccessTreeProvider {
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
new QuickItem(
|
new QuickItem(
|
||||||
'DevStar Home',
|
vscode.l10n.t('DevStar Home'),
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
vscode.TreeItemCollapsibleState.Expanded,
|
vscode.TreeItemCollapsibleState.Expanded,
|
||||||
[new QuickItem('Open', 'devstar.showHome')]
|
[new QuickItem(vscode.l10n.t('Open'), 'devstar.showHome')]
|
||||||
),
|
),
|
||||||
new QuickItem(
|
new QuickItem(
|
||||||
'Miscellaneous',
|
vscode.l10n.t('Miscellaneous'),
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
vscode.TreeItemCollapsibleState.Expanded,
|
vscode.TreeItemCollapsibleState.Expanded,
|
||||||
// [new QuickItem('Connect Remote Container', 'devstar.connectRemoteContainer')]
|
// [new QuickItem('Connect Remote Container', 'devstar.connectRemoteContainer')]
|
||||||
[new QuickItem('[Temp]Logout', 'devstar.logout')]
|
[new QuickItem(vscode.l10n.t('Clean'), 'devstar.clean')]
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user