mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Initial version of i18n-sample
To keep things simple, this doesn't use the nls-dev package. I think this demystifies a lot of things when you see what is actually going on behind the scenes.
This commit is contained in:
2
i18n-sample/.gitignore
vendored
2
i18n-sample/.gitignore
vendored
@ -1,3 +1,3 @@
|
||||
out
|
||||
node_modules
|
||||
package.nls.*.json
|
||||
package.nls.*.json
|
||||
17
i18n-sample/.vscode/launch.json
vendored
Normal file
17
i18n-sample/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// A launch configuration that compiles the extension and then opens it inside a new window
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
|
||||
"preLaunchTask": "npm"
|
||||
}
|
||||
]
|
||||
}
|
||||
9
i18n-sample/.vscode/settings.json
vendored
Normal file
9
i18n-sample/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Place your settings in this file to overwrite default and user settings.
|
||||
{
|
||||
"files.exclude": {
|
||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||
},
|
||||
"search.exclude": {
|
||||
"out": true // set this to false to include "out" folder in search results
|
||||
}
|
||||
}
|
||||
9
i18n-sample/.vscodeignore
Normal file
9
i18n-sample/.vscodeignore
Normal file
@ -0,0 +1,9 @@
|
||||
.vscode/**
|
||||
.vscode-test/**
|
||||
out/test/**
|
||||
test/**
|
||||
src/**
|
||||
**/*.map
|
||||
.gitignore
|
||||
tsconfig.json
|
||||
vsc-extension-quickstart.md
|
||||
@ -99,4 +99,4 @@ Hook up the vscode-nls-dev functions to gulp so that you can just run `vsce pack
|
||||
|
||||
## 0.0.1:
|
||||
|
||||
Manually transform the calls to localize to illustrate explicitly what is going on.
|
||||
Manually transform the calls to localize to illustrate explicitly what is going on.
|
||||
|
||||
BIN
i18n-sample/i18n-sample-0.0.1.vsix
Normal file
BIN
i18n-sample/i18n-sample-0.0.1.vsix
Normal file
Binary file not shown.
@ -48,4 +48,4 @@
|
||||
"dependencies": {
|
||||
"vscode-nls": "^2.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
i18n-sample/package.nls.ja.json
Normal file
4
i18n-sample/package.nls.ja.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extension.sayHello.title": "こんにちは",
|
||||
"extension.sayBye.title": "さようなら"
|
||||
}
|
||||
1
i18n-sample/src/command/sayBye.nls.ja.json
Normal file
1
i18n-sample/src/command/sayBye.nls.ja.json
Normal file
@ -0,0 +1 @@
|
||||
["さようなら"]
|
||||
4
i18n-sample/src/command/sayBye.nls.json
Normal file
4
i18n-sample/src/command/sayBye.nls.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"messages": ["Bye"],
|
||||
"keys": ["sayBye.text"]
|
||||
}
|
||||
@ -11,4 +11,4 @@ const localize = nls.loadMessageBundle();
|
||||
export function sayByeCommand() {
|
||||
const message = localize('sayBye.text', 'Bye')
|
||||
vscode.window.showInformationMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
1
i18n-sample/src/extension.nls.ja.json
Normal file
1
i18n-sample/src/extension.nls.ja.json
Normal file
@ -0,0 +1 @@
|
||||
["こんにちは"]
|
||||
4
i18n-sample/src/extension.nls.json
Normal file
4
i18n-sample/src/extension.nls.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"messages": ["Hello"],
|
||||
"keys": ["sayHello.text"]
|
||||
}
|
||||
@ -24,4 +24,4 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user