Skip to content

Commit

Permalink
feat: support vscode l10n
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Oct 27, 2024
1 parent eb5902a commit 0acee93
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 62 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* publish: https://vscode.github.net.cn/api/working-with-extensions/publishing-extension
* https://code.visualstudio.com/api/extension-guides/webview
* icon: https://code.visualstudio.com/api/references/icons-in-labels
* l10n: https://code.visualstudio.com/api/references/vscode-api#l10n
-->

## prerequisites
Expand Down Expand Up @@ -41,12 +42,11 @@

<!-- commands -->

| Command | Title |
| ----------------------- | ---------------------------------- |
| `usewiki2.tiddlywiki` | UseWiki2: Add Journal |
| `usewiki2.wikiinfo` | Usewiki2: Info |
| `usewiki2.openwiki` | Usewiki2: Open TiddlyWiki Instance |
| `usewiki2.opensettings` | Usewiki2: Settings |
| Command | Title |
| ----------------------- | ----------------------------- |
| `usewiki2.wikiinfo` | %usewiki2.tiddlywiki.title% |
| `usewiki2.openwiki` | %usewiki2.openwiki.title% |
| `usewiki2.opensettings` | %usewiki2.opensettings.title% |

<!-- commands -->

Expand Down
37 changes: 15 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"publisher": "oeyoews",
"name": "usewiki2",
"displayName": "usewiki2",
"version": "2.5.0",
"version": "2.6.0",
"private": true,
"packageManager": "[email protected]",
"description": "",
Expand All @@ -28,6 +28,7 @@
"engines": {
"vscode": "^1.94.0"
},
"l10n": "./l10n",
"activationEvents": [
"onStartupFinished"
],
Expand All @@ -39,41 +40,35 @@
"usewiki2.enableSendSound": {
"type": "boolean",
"default": false,
"description": "启用发送声音"
},
"usewiki2.placeholder": {
"type": "string",
"default": "",
"deprecationMessage": "已废弃",
"description": "默认提示符"
"description": "%usewiki2.enableSendSound.title%"
},
"usewiki2.defaultTag": {
"type": "string",
"default": "Journal",
"description": "默认标签"
"description": "%usewiki2.defaultTag.title%"
},
"usewiki2.defaultUsername": {
"type": "string",
"default": "",
"description": "默认用户名"
"description": "%usewiki2.defaultUsername%"
},
"usewiki2.ip": {
"order": 0,
"type": "string",
"default": "127.0.0.1",
"markdownDescription": "你的TiddlyWiki地址 (请确定你已经启动了[太微](https://tiddlywiki.com/#Installing%20TiddlyWiki%20on%20Node.js))"
"description": "%usewiki2.ip%"
},
"usewiki2.port": {
"order": 1,
"type": "number",
"default": 8080,
"description": "端口 (请确定你已经启动了太微)"
"description": "%usewiki2.port%"
},
"usewiki2.enableHttps": {
"order": 2,
"type": "boolean",
"default": false,
"markdownDescription": "Enable or Disable HTTPS(untest for https)"
"description": "%usewiki2.enableHttps%"
},
"usewiki2.lang": {
"type": "string",
Expand All @@ -86,7 +81,7 @@
"English",
"Simplified Chinese"
],
"description": "Setup the language of the UseWiki2"
"description": "%usewiki2.lang%"
},
"usewiki2.type": {
"order": 3,
Expand All @@ -104,7 +99,7 @@
"use Markdown",
"use WikiText"
],
"description": "选择要使用的文本格式 (Markdown 或 TiddlyWiki)"
"description": "%usewiki2.type%"
}
}
},
Expand Down Expand Up @@ -146,23 +141,19 @@
]
},
"commands": [
{
"command": "usewiki2.tiddlywiki",
"title": "UseWiki2: Add Journal"
},
{
"command": "usewiki2.wikiinfo",
"title": "Usewiki2: Info",
"title": "%usewiki2.tiddlywiki.title%",
"icon": "$(info)"
},
{
"command": "usewiki2.openwiki",
"title": "Usewiki2: Open TiddlyWiki Instance",
"title": "%usewiki2.openwiki.title%",
"icon": "$(link-external)"
},
{
"command": "usewiki2.opensettings",
"title": "Usewiki2: Settings",
"title": "%usewiki2.opensettings.title%",
"icon": "$(gear)"
}
]
Expand All @@ -185,6 +176,7 @@
"@antfu/ni": "^0.21.12",
"@types/node": "^20.14.11",
"@types/vscode": "^1.91.0",
"@vscode/l10n-dev": "^0.0.35",
"@vscode/vsce": "3.2.0",
"bumpp": "^9.4.1",
"eslint": "^8.57.0",
Expand All @@ -211,6 +203,7 @@
"LICENSE"
],
"dependencies": {
"@vscode/l10n": "^0.0.18",
"reactive-vscode": "0.2.0"
}
}
13 changes: 13 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"usewiki2.tiddlywiki.title": "Show Tiddlywiki Info",
"usewiki2.openwiki.title": "Open Tiddlywiki Instance",
"usewiki2.opensettings.title": "Open Tiddlywiki Settings",
"usewiki2.enableSendSound.title": "Enable Send Sound",
"usewiki2.defaultTag.title": "Tag",
"usewiki2.defaultUsername": "username",
"usewiki2.ip": "Your Nodejs Tiddlywiki IP",
"usewiki2.port": "Port",
"usewiki2.enableHttps": "Enable HTTPS",
"usewiki2.lang": "Setup Usewiki2 Language",
"usewiki2.type": "saved type"
}
13 changes: 13 additions & 0 deletions package.nls.zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"usewiki2.tiddlywiki.title": "显示tiddlywiki实例信息",
"usewiki2.openwiki.title": "在浏览器中打开tiddlywiki实例",
"usewiki2.opensettings.title": "配置太微助手",
"usewiki2.enableSendSound.title": "开启发送声音",
"usewiki2.defaultTag.title": "默认标签",
"usewiki2.defaultUsername": "用户名",
"usewiki2.ip": "太微 IP 地址",
"usewiki2.port": "端口号",
"usewiki2.enableHttps": "使用 Htttps",
"usewiki2.lang": "设置太微助手语言",
"usewiki2.type": "保存类型"
}
Loading

0 comments on commit 0acee93

Please sign in to comment.