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:
Nick Chen
2017-07-08 14:59:34 -07:00
committed by Dirk Baeumer
parent 9ec4b5deeb
commit ff96d2a669
14 changed files with 54 additions and 5 deletions

View File

@ -1,3 +1,3 @@
out
node_modules
package.nls.*.json
package.nls.*.json

17
i18n-sample/.vscode/launch.json vendored Normal file
View 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
View 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
}
}

View File

@ -0,0 +1,9 @@
.vscode/**
.vscode-test/**
out/test/**
test/**
src/**
**/*.map
.gitignore
tsconfig.json
vsc-extension-quickstart.md

View File

@ -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.

Binary file not shown.

View File

@ -48,4 +48,4 @@
"dependencies": {
"vscode-nls": "^2.0.2"
}
}
}

View File

@ -0,0 +1,4 @@
{
"extension.sayHello.title": "こんにちは",
"extension.sayBye.title": "さようなら"
}

View File

@ -0,0 +1 @@
["さようなら"]

View File

@ -0,0 +1,4 @@
{
"messages": ["Bye"],
"keys": ["sayBye.text"]
}

View File

@ -11,4 +11,4 @@ const localize = nls.loadMessageBundle();
export function sayByeCommand() {
const message = localize('sayBye.text', 'Bye')
vscode.window.showInformationMessage(message);
}
}

View File

@ -0,0 +1 @@
["こんにちは"]

View File

@ -0,0 +1,4 @@
{
"messages": ["Hello"],
"keys": ["sayHello.text"]
}

View File

@ -24,4 +24,4 @@ export function activate(context: vscode.ExtensionContext) {
}
export function deactivate() {
}
}