Revamping to matrix style
This commit is contained in:
5
node_modules/vscode-nls/lib/node/main.d.ts
generated
vendored
Normal file
5
node_modules/vscode-nls/lib/node/main.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Options, LocalizeFunc, LoadFunc } from '../common/common';
|
||||
export { MessageFormat, BundleFormat, Options, LocalizeInfo, LocalizeFunc, LoadFunc, KeyInfo } from '../common/common';
|
||||
export declare function loadMessageBundle(file?: string): LocalizeFunc;
|
||||
export declare function config(opts?: Options): LoadFunc;
|
||||
//# sourceMappingURL=main.d.ts.map
|
||||
1
node_modules/vscode-nls/lib/node/main.d.ts.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/main.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/node/main.ts"],"names":[],"mappings":"AAUA,OAAO,EACyE,OAAO,EAAqC,YAAY,EAC5D,QAAQ,EACnF,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA4WvH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAuE7D;AAED,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAgB/C"}
|
||||
449
node_modules/vscode-nls/lib/node/main.js
generated
vendored
Normal file
449
node_modules/vscode-nls/lib/node/main.js
generated
vendored
Normal file
@@ -0,0 +1,449 @@
|
||||
"use strict";
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.config = exports.loadMessageBundle = exports.BundleFormat = exports.MessageFormat = void 0;
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
var ral_1 = require("../common/ral");
|
||||
var common_1 = require("../common/common");
|
||||
var common_2 = require("../common/common");
|
||||
Object.defineProperty(exports, "MessageFormat", { enumerable: true, get: function () { return common_2.MessageFormat; } });
|
||||
Object.defineProperty(exports, "BundleFormat", { enumerable: true, get: function () { return common_2.BundleFormat; } });
|
||||
var toString = Object.prototype.toString;
|
||||
function isNumber(value) {
|
||||
return toString.call(value) === '[object Number]';
|
||||
}
|
||||
function isString(value) {
|
||||
return toString.call(value) === '[object String]';
|
||||
}
|
||||
function isBoolean(value) {
|
||||
return value === true || value === false;
|
||||
}
|
||||
function readJsonFileSync(filename) {
|
||||
return JSON.parse(fs.readFileSync(filename, 'utf8'));
|
||||
}
|
||||
var resolvedBundles;
|
||||
var options;
|
||||
function initializeSettings() {
|
||||
options = { locale: undefined, language: undefined, languagePackSupport: false, cacheLanguageResolution: true, messageFormat: common_1.MessageFormat.bundle };
|
||||
if (isString(process.env.VSCODE_NLS_CONFIG)) {
|
||||
try {
|
||||
var vscodeOptions_1 = JSON.parse(process.env.VSCODE_NLS_CONFIG);
|
||||
var language = void 0;
|
||||
if (vscodeOptions_1.availableLanguages) {
|
||||
var value = vscodeOptions_1.availableLanguages['*'];
|
||||
if (isString(value)) {
|
||||
language = value;
|
||||
}
|
||||
}
|
||||
if (isString(vscodeOptions_1.locale)) {
|
||||
options.locale = vscodeOptions_1.locale.toLowerCase();
|
||||
}
|
||||
if (language === undefined) {
|
||||
options.language = options.locale;
|
||||
}
|
||||
else if (language !== 'en') {
|
||||
options.language = language;
|
||||
}
|
||||
if (isBoolean(vscodeOptions_1._languagePackSupport)) {
|
||||
options.languagePackSupport = vscodeOptions_1._languagePackSupport;
|
||||
}
|
||||
if (isString(vscodeOptions_1._cacheRoot)) {
|
||||
options.cacheRoot = vscodeOptions_1._cacheRoot;
|
||||
}
|
||||
if (isString(vscodeOptions_1._languagePackId)) {
|
||||
options.languagePackId = vscodeOptions_1._languagePackId;
|
||||
}
|
||||
if (isString(vscodeOptions_1._translationsConfigFile)) {
|
||||
options.translationsConfigFile = vscodeOptions_1._translationsConfigFile;
|
||||
try {
|
||||
options.translationsConfig = readJsonFileSync(options.translationsConfigFile);
|
||||
}
|
||||
catch (error) {
|
||||
// We can't read the translation config file. Mark the cache as corrupted.
|
||||
if (vscodeOptions_1._corruptedFile) {
|
||||
var dirname = path.dirname(vscodeOptions_1._corruptedFile);
|
||||
fs.exists(dirname, function (exists) {
|
||||
if (exists) {
|
||||
fs.writeFile(vscodeOptions_1._corruptedFile, 'corrupted', 'utf8', function (err) {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (_a) {
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
(0, common_1.setPseudo)(options.locale === 'pseudo');
|
||||
resolvedBundles = Object.create(null);
|
||||
}
|
||||
initializeSettings();
|
||||
function supportsLanguagePack() {
|
||||
return options.languagePackSupport === true && options.cacheRoot !== undefined && options.languagePackId !== undefined && options.translationsConfigFile !== undefined
|
||||
&& options.translationsConfig !== undefined;
|
||||
}
|
||||
function createScopedLocalizeFunction(messages) {
|
||||
return function (key, message) {
|
||||
var args = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
args[_i - 2] = arguments[_i];
|
||||
}
|
||||
if (isNumber(key)) {
|
||||
if (key >= messages.length) {
|
||||
console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: ".concat(new Error('').stack));
|
||||
return;
|
||||
}
|
||||
return (0, common_1.format)(messages[key], args);
|
||||
}
|
||||
else {
|
||||
if (isString(message)) {
|
||||
console.warn("Message ".concat(message, " didn't get externalized correctly."));
|
||||
return (0, common_1.format)(message, args);
|
||||
}
|
||||
else {
|
||||
console.error("Broken localize call found. Stacktrace is\n: ".concat(new Error('').stack));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function resolveLanguage(file) {
|
||||
var resolvedLanguage;
|
||||
if (options.cacheLanguageResolution && resolvedLanguage) {
|
||||
resolvedLanguage = resolvedLanguage;
|
||||
}
|
||||
else {
|
||||
if (common_1.isPseudo || !options.language) {
|
||||
resolvedLanguage = '.nls.json';
|
||||
}
|
||||
else {
|
||||
var locale = options.language;
|
||||
while (locale) {
|
||||
var candidate = '.nls.' + locale + '.json';
|
||||
if (fs.existsSync(file + candidate)) {
|
||||
resolvedLanguage = candidate;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
var index = locale.lastIndexOf('-');
|
||||
if (index > 0) {
|
||||
locale = locale.substring(0, index);
|
||||
}
|
||||
else {
|
||||
resolvedLanguage = '.nls.json';
|
||||
locale = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (options.cacheLanguageResolution) {
|
||||
resolvedLanguage = resolvedLanguage;
|
||||
}
|
||||
}
|
||||
return file + resolvedLanguage;
|
||||
}
|
||||
function findInTheBoxBundle(root) {
|
||||
var language = options.language;
|
||||
while (language) {
|
||||
var candidate = path.join(root, "nls.bundle.".concat(language, ".json"));
|
||||
if (fs.existsSync(candidate)) {
|
||||
return candidate;
|
||||
}
|
||||
else {
|
||||
var index = language.lastIndexOf('-');
|
||||
if (index > 0) {
|
||||
language = language.substring(0, index);
|
||||
}
|
||||
else {
|
||||
language = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Test if we can reslove the default bundle.
|
||||
if (language === undefined) {
|
||||
var candidate = path.join(root, 'nls.bundle.json');
|
||||
if (fs.existsSync(candidate)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
function mkdir(directory) {
|
||||
try {
|
||||
fs.mkdirSync(directory);
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === 'EEXIST') {
|
||||
return;
|
||||
}
|
||||
else if (err.code === 'ENOENT') {
|
||||
var parent = path.dirname(directory);
|
||||
if (parent !== directory) {
|
||||
mkdir(parent);
|
||||
fs.mkdirSync(directory);
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
function createDefaultNlsBundle(folder) {
|
||||
var metaData = readJsonFileSync(path.join(folder, 'nls.metadata.json'));
|
||||
var result = Object.create(null);
|
||||
for (var module_1 in metaData) {
|
||||
var entry = metaData[module_1];
|
||||
result[module_1] = entry.messages;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function createNLSBundle(header, metaDataPath) {
|
||||
var languagePackLocation = options.translationsConfig[header.id];
|
||||
if (!languagePackLocation) {
|
||||
return undefined;
|
||||
}
|
||||
var languagePack = readJsonFileSync(languagePackLocation).contents;
|
||||
var metaData = readJsonFileSync(path.join(metaDataPath, 'nls.metadata.json'));
|
||||
var result = Object.create(null);
|
||||
for (var module_2 in metaData) {
|
||||
var entry = metaData[module_2];
|
||||
var translations = languagePack["".concat(header.outDir, "/").concat(module_2)];
|
||||
if (translations) {
|
||||
var resultMessages = [];
|
||||
for (var i = 0; i < entry.keys.length; i++) {
|
||||
var messageKey = entry.keys[i];
|
||||
var key = isString(messageKey) ? messageKey : messageKey.key;
|
||||
var translatedMessage = translations[key];
|
||||
if (translatedMessage === undefined) {
|
||||
translatedMessage = entry.messages[i];
|
||||
}
|
||||
resultMessages.push(translatedMessage);
|
||||
}
|
||||
result[module_2] = resultMessages;
|
||||
}
|
||||
else {
|
||||
result[module_2] = entry.messages;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function touch(file) {
|
||||
var d = new Date();
|
||||
fs.utimes(file, d, d, function () {
|
||||
// Do nothing. Ignore
|
||||
});
|
||||
}
|
||||
function cacheBundle(key, bundle) {
|
||||
resolvedBundles[key] = bundle;
|
||||
return bundle;
|
||||
}
|
||||
function loadNlsBundleOrCreateFromI18n(header, bundlePath) {
|
||||
var result;
|
||||
var bundle = path.join(options.cacheRoot, "".concat(header.id, "-").concat(header.hash, ".json"));
|
||||
var useMemoryOnly = false;
|
||||
var writeBundle = false;
|
||||
try {
|
||||
result = JSON.parse(fs.readFileSync(bundle, { encoding: 'utf8', flag: 'r' }));
|
||||
touch(bundle);
|
||||
return result;
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
writeBundle = true;
|
||||
}
|
||||
else if (err instanceof SyntaxError) {
|
||||
// We have a syntax error. So no valid JSON. Use
|
||||
console.log("Syntax error parsing message bundle: ".concat(err.message, "."));
|
||||
fs.unlink(bundle, function (err) {
|
||||
if (err) {
|
||||
console.error("Deleting corrupted bundle ".concat(bundle, " failed."));
|
||||
}
|
||||
});
|
||||
useMemoryOnly = true;
|
||||
}
|
||||
else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
result = createNLSBundle(header, bundlePath);
|
||||
if (!result || useMemoryOnly) {
|
||||
return result;
|
||||
}
|
||||
if (writeBundle) {
|
||||
try {
|
||||
fs.writeFileSync(bundle, JSON.stringify(result), { encoding: 'utf8', flag: 'wx' });
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === 'EEXIST') {
|
||||
return result;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function loadDefaultNlsBundle(bundlePath) {
|
||||
try {
|
||||
return createDefaultNlsBundle(bundlePath);
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Generating default bundle from meta data failed.", err);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function loadNlsBundle(header, bundlePath) {
|
||||
var result;
|
||||
// Core decided to use a language pack. Do the same in the extension
|
||||
if (supportsLanguagePack()) {
|
||||
try {
|
||||
result = loadNlsBundleOrCreateFromI18n(header, bundlePath);
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Load or create bundle failed ", err);
|
||||
}
|
||||
}
|
||||
if (!result) {
|
||||
// No language pack found, but core is running in language pack mode
|
||||
// Don't try to use old in the box bundles since the might be stale
|
||||
// Fall right back to the default bundle.
|
||||
if (options.languagePackSupport) {
|
||||
return loadDefaultNlsBundle(bundlePath);
|
||||
}
|
||||
var candidate = findInTheBoxBundle(bundlePath);
|
||||
if (candidate) {
|
||||
try {
|
||||
return readJsonFileSync(candidate);
|
||||
}
|
||||
catch (err) {
|
||||
console.log("Loading in the box message bundle failed.", err);
|
||||
}
|
||||
}
|
||||
result = loadDefaultNlsBundle(bundlePath);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function tryFindMetaDataHeaderFile(file) {
|
||||
var result;
|
||||
var dirname = path.dirname(file);
|
||||
while (true) {
|
||||
result = path.join(dirname, 'nls.metadata.header.json');
|
||||
if (fs.existsSync(result)) {
|
||||
break;
|
||||
}
|
||||
var parent = path.dirname(dirname);
|
||||
if (parent === dirname) {
|
||||
result = undefined;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
dirname = parent;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function loadMessageBundle(file) {
|
||||
if (!file) {
|
||||
// No file. We are in dev mode. Return the default
|
||||
// localize function.
|
||||
return common_1.localize;
|
||||
}
|
||||
// Remove extension since we load json files.
|
||||
var ext = path.extname(file);
|
||||
if (ext) {
|
||||
file = file.substr(0, file.length - ext.length);
|
||||
}
|
||||
if (options.messageFormat === common_1.MessageFormat.both || options.messageFormat === common_1.MessageFormat.bundle) {
|
||||
var headerFile = tryFindMetaDataHeaderFile(file);
|
||||
if (headerFile) {
|
||||
var bundlePath = path.dirname(headerFile);
|
||||
var bundle = resolvedBundles[bundlePath];
|
||||
if (bundle === undefined) {
|
||||
try {
|
||||
var header = JSON.parse(fs.readFileSync(headerFile, 'utf8'));
|
||||
try {
|
||||
var nlsBundle = loadNlsBundle(header, bundlePath);
|
||||
bundle = cacheBundle(bundlePath, nlsBundle ? { header: header, nlsBundle: nlsBundle } : null);
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Failed to load nls bundle', err);
|
||||
bundle = cacheBundle(bundlePath, null);
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
console.error('Failed to read header file', err);
|
||||
bundle = cacheBundle(bundlePath, null);
|
||||
}
|
||||
}
|
||||
if (bundle) {
|
||||
var module_3 = file.substr(bundlePath.length + 1).replace(/\\/g, '/');
|
||||
var messages = bundle.nlsBundle[module_3];
|
||||
if (messages === undefined) {
|
||||
console.error("Messages for file ".concat(file, " not found. See console for details."));
|
||||
return function () {
|
||||
return 'Messages not found.';
|
||||
};
|
||||
}
|
||||
return createScopedLocalizeFunction(messages);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (options.messageFormat === common_1.MessageFormat.both || options.messageFormat === common_1.MessageFormat.file) {
|
||||
// Try to load a single file bundle
|
||||
try {
|
||||
var json = readJsonFileSync(resolveLanguage(file));
|
||||
if (Array.isArray(json)) {
|
||||
return createScopedLocalizeFunction(json);
|
||||
}
|
||||
else {
|
||||
if ((0, common_1.isDefined)(json.messages) && (0, common_1.isDefined)(json.keys)) {
|
||||
return createScopedLocalizeFunction(json.messages);
|
||||
}
|
||||
else {
|
||||
console.error("String bundle '".concat(file, "' uses an unsupported format."));
|
||||
return function () {
|
||||
return 'File bundle has unsupported format. See console for details';
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code !== 'ENOENT') {
|
||||
console.error('Failed to load single file bundle', err);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.error("Failed to load message bundle for file ".concat(file));
|
||||
return function () {
|
||||
return 'Failed to load message bundle. See console for details.';
|
||||
};
|
||||
}
|
||||
exports.loadMessageBundle = loadMessageBundle;
|
||||
function config(opts) {
|
||||
if (opts) {
|
||||
if (isString(opts.locale)) {
|
||||
options.locale = opts.locale.toLowerCase();
|
||||
options.language = options.locale;
|
||||
resolvedBundles = Object.create(null);
|
||||
}
|
||||
if (opts.messageFormat !== undefined) {
|
||||
options.messageFormat = opts.messageFormat;
|
||||
}
|
||||
if (opts.bundleFormat === common_1.BundleFormat.standalone && options.languagePackSupport === true) {
|
||||
options.languagePackSupport = false;
|
||||
}
|
||||
}
|
||||
(0, common_1.setPseudo)(options.locale === 'pseudo');
|
||||
return loadMessageBundle;
|
||||
}
|
||||
exports.config = config;
|
||||
ral_1.default.install(Object.freeze({
|
||||
loadMessageBundle: loadMessageBundle,
|
||||
config: config
|
||||
}));
|
||||
//# sourceMappingURL=main.js.map
|
||||
1
node_modules/vscode-nls/lib/node/main.js.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/main.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
node_modules/vscode-nls/lib/node/test/localize.test.d.ts
generated
vendored
Normal file
2
node_modules/vscode-nls/lib/node/test/localize.test.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=localize.test.d.ts.map
|
||||
1
node_modules/vscode-nls/lib/node/test/localize.test.d.ts.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/test/localize.test.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"localize.test.d.ts","sourceRoot":"","sources":["../../../src/node/test/localize.test.ts"],"names":[],"mappings":""}
|
||||
65
node_modules/vscode-nls/lib/node/test/localize.test.js
generated
vendored
Normal file
65
node_modules/vscode-nls/lib/node/test/localize.test.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert = require("assert");
|
||||
var path = require("path");
|
||||
var nls = require("../main");
|
||||
var root = path.join(__dirname, '..', '..', '..', 'src', 'node', 'test');
|
||||
describe('Localize', function () {
|
||||
it('Simple call', function () {
|
||||
var localize = nls.config({ locale: 'de-DE' })();
|
||||
var message = 'Hello World';
|
||||
assert.strictEqual(localize('key', message), message);
|
||||
});
|
||||
it('Simple call with separate load', function () {
|
||||
nls.config({ locale: 'de-DE' });
|
||||
var localize = nls.loadMessageBundle();
|
||||
var message = 'Hello World';
|
||||
assert.strictEqual(localize('key', message), message);
|
||||
});
|
||||
it('With args', function () {
|
||||
var localize = nls.config({ locale: 'de-DE' })();
|
||||
var message = '{0} {1}';
|
||||
assert.strictEqual(localize('key', message, 'Hello', 'World'), 'Hello World');
|
||||
});
|
||||
it('Pseudo', function () {
|
||||
var localize = nls.config({ locale: 'pseudo' })();
|
||||
var message = 'Hello World';
|
||||
assert.strictEqual(localize('key', message), '\uFF3BHeelloo Woorld\uFF3D');
|
||||
});
|
||||
it('Pseudo with args', function () {
|
||||
var localize = nls.config({ locale: 'pseudo' })();
|
||||
var message = 'Hello {0} World';
|
||||
assert.strictEqual(localize('key', message, 'bright'), '\uFF3BHeelloo bright Woorld\uFF3D');
|
||||
});
|
||||
it('External Data German flat', function () {
|
||||
var localize = nls.config({ locale: 'de-DE', messageFormat: nls.MessageFormat.file })(path.join(root, 'data'));
|
||||
assert.strictEqual(localize(0, null), 'Guten Tag Welt');
|
||||
});
|
||||
it('External Data German flat with extension', function () {
|
||||
var localize = nls.config({ locale: 'de-DE', messageFormat: nls.MessageFormat.file })(path.join(root, 'data.js'));
|
||||
assert.strictEqual(localize(0, null), 'Guten Tag Welt');
|
||||
});
|
||||
it('External Data German flat with extension separate load', function () {
|
||||
nls.config({ locale: 'de-DE', messageFormat: nls.MessageFormat.file });
|
||||
var localize = nls.loadMessageBundle(path.join(root, 'data.js'));
|
||||
assert.strictEqual(localize(0, null), 'Guten Tag Welt');
|
||||
});
|
||||
it('External Data German structured', function () {
|
||||
var localize = nls.config({ locale: 'de-DE', messageFormat: nls.MessageFormat.file })(path.join(root, 'dataStructured'));
|
||||
assert.strictEqual(localize(0, null), 'Guten Tag Welt');
|
||||
assert.strictEqual(localize(1, null), 'Auf Wiedersehen Welt');
|
||||
});
|
||||
it('External Bundle', function () {
|
||||
var localize = nls.config({ locale: 'de-DE', messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(path.join(root, 'localize.test.js'));
|
||||
assert.strictEqual(localize(0, null), 'Guten Tag Welt');
|
||||
});
|
||||
it('Default data file', function () {
|
||||
var localize = nls.config({ locale: 'zh-tw', messageFormat: nls.MessageFormat.file })(path.join(root, 'data'));
|
||||
assert.strictEqual(localize(0, null), 'Hello World');
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=localize.test.js.map
|
||||
1
node_modules/vscode-nls/lib/node/test/localize.test.js.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/test/localize.test.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"localize.test.js","sourceRoot":"","sources":["../../../src/node/test/localize.test.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,YAAY,CAAC;;AAEb,+BAAiC;AACjC,2BAA6B;AAE7B,6BAA+B;AAE/B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAG,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1E,QAAQ,CAAC,UAAU,EAAE;IACpB,EAAE,CAAC,aAAa,EAAE;QACjB,IAAI,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QACjD,IAAI,OAAO,GAAG,aAAa,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE;QACpC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAChC,IAAI,QAAQ,GAAG,GAAG,CAAC,iBAAiB,EAAE,CAAC;QACvC,IAAI,OAAO,GAAG,aAAa,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC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CAAC,CAAC;IAEH,EAAE,CAAE,iBAAiB,EAAE;QACtB,IAAI,QAAQ,GAAO,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC;QAC5K,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mBAAmB,EAAE;QACvB,IAAI,QAAQ,GAAO,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACnH,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
||||
1
node_modules/vscode-nls/lib/node/test/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/test/tsconfig.tsbuildinfo
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/vscode-nls/lib/node/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/node/tsconfig.tsbuildinfo
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user