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",
 | 
			
		||||
  "displayName": "%displayName%",
 | 
			
		||||
  "description": "%description%",
 | 
			
		||||
  "version": "0.2.12",
 | 
			
		||||
  "keywords": [],
 | 
			
		||||
  "publisher": "mengning",
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "vscode": "^1.75.0"
 | 
			
		||||
  },
 | 
			
		||||
  "l10n": "./l10n",
 | 
			
		||||
  "license": "Apache-2.0",
 | 
			
		||||
  "displayName": "DevStar",
 | 
			
		||||
  "description": "",
 | 
			
		||||
  "categories": [],
 | 
			
		||||
  "keywords": [],
 | 
			
		||||
  "main": "./dist/extension",
 | 
			
		||||
  "icon": "assets/images/devstar-logo.png",
 | 
			
		||||
  "bugs": {
 | 
			
		||||
@@ -28,12 +29,12 @@
 | 
			
		||||
    "commands": [
 | 
			
		||||
      {
 | 
			
		||||
        "command": "devstar.showHome",
 | 
			
		||||
        "title": "DevStar Home",
 | 
			
		||||
        "title": "%devstar.showHome.title%",
 | 
			
		||||
        "category": "DevStar"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "command": "devstar.connectRemoteContainer",
 | 
			
		||||
        "title": "Connect to a Remote Container",
 | 
			
		||||
        "title": "%devstar.connectRemoteContainer.title%",
 | 
			
		||||
        "category": "DevStar"
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
@@ -41,6 +42,30 @@
 | 
			
		||||
      "protocol": "vscode",
 | 
			
		||||
      "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": {
 | 
			
		||||
      "file/newFile": [
 | 
			
		||||
        {
 | 
			
		||||
@@ -50,38 +75,6 @@
 | 
			
		||||
      ],
 | 
			
		||||
      "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": {
 | 
			
		||||
      "type": "object",
 | 
			
		||||
      "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) {
 | 
			
		||||
    const panel = vscode.window.createWebviewPanel(
 | 
			
		||||
      'homeWebview',
 | 
			
		||||
      'Home',
 | 
			
		||||
      vscode.l10n.t('Home'),
 | 
			
		||||
      vscode.ViewColumn.One,
 | 
			
		||||
      {
 | 
			
		||||
        enableScripts: true,
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,7 @@ export default class RemoteContainer {
 | 
			
		||||
      const ssh = new NodeSSH();
 | 
			
		||||
      vscode.window.withProgress({
 | 
			
		||||
        location: vscode.ProgressLocation.Notification,
 | 
			
		||||
        title: "正在容器中安装vscode-server及devstar插件",
 | 
			
		||||
        title: vscode.l10n.t("Installing vscode-server and devstar extension in container"),
 | 
			
		||||
        cancellable: false
 | 
			
		||||
      }, async (progress) => {
 | 
			
		||||
        try {
 | 
			
		||||
@@ -46,7 +46,7 @@ export default class RemoteContainer {
 | 
			
		||||
              port: port,
 | 
			
		||||
              privateKeyPath: this.user.getUserPrivateKeyPath()
 | 
			
		||||
            });
 | 
			
		||||
            progress.report({ message: "连接成功,开始安装" });
 | 
			
		||||
            progress.report({ message: vscode.l10n.t("Connected! Start installation")});
 | 
			
		||||
 | 
			
		||||
            // install vscode-server and devstar extension
 | 
			
		||||
            const vscodeCommitId = await utils.getVsCodeCommitId()
 | 
			
		||||
@@ -67,7 +67,7 @@ export default class RemoteContainer {
 | 
			
		||||
            `;
 | 
			
		||||
              await ssh.execCommand(installVscodeServerScript);
 | 
			
		||||
              console.log("vscode-server and extension installed");
 | 
			
		||||
              vscode.window.showInformationMessage('安装完成!');
 | 
			
		||||
              vscode.window.showInformationMessage(vscode.l10n.t('Installation completed!'));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            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'
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
      console.error(error)
 | 
			
		||||
@@ -70,7 +70,7 @@ export default class User {
 | 
			
		||||
  public logout() {
 | 
			
		||||
    this.setUserTokenToLocal("")
 | 
			
		||||
    this.setUsernameToLocal("")
 | 
			
		||||
    vscode.window.showInformationMessage('用户已登出!')
 | 
			
		||||
    vscode.window.showInformationMessage(vscode.l10n.t("User has logged out!"))
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public isLogged() {
 | 
			
		||||
 
 | 
			
		||||
@@ -24,19 +24,19 @@ export default class QuickAccessTreeProvider {
 | 
			
		||||
 | 
			
		||||
    return [
 | 
			
		||||
      new QuickItem(
 | 
			
		||||
        'DevStar Home',
 | 
			
		||||
        vscode.l10n.t('DevStar Home'),
 | 
			
		||||
        undefined,
 | 
			
		||||
        undefined,
 | 
			
		||||
        vscode.TreeItemCollapsibleState.Expanded,
 | 
			
		||||
        [new QuickItem('Open', 'devstar.showHome')]
 | 
			
		||||
        [new QuickItem(vscode.l10n.t('Open'), 'devstar.showHome')]
 | 
			
		||||
      ),
 | 
			
		||||
      new QuickItem(
 | 
			
		||||
        'Miscellaneous',
 | 
			
		||||
        vscode.l10n.t('Miscellaneous'),
 | 
			
		||||
        undefined,
 | 
			
		||||
        undefined,
 | 
			
		||||
        vscode.TreeItemCollapsibleState.Expanded,
 | 
			
		||||
        // [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