Revamping to matrix style
This commit is contained in:
5
node_modules/vscode-nls/lib/browser/main.d.ts
generated
vendored
Normal file
5
node_modules/vscode-nls/lib/browser/main.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Options, LocalizeInfo } from '../common/common';
|
||||
export { MessageFormat, BundleFormat, Options, LocalizeInfo, LocalizeFunc, LoadFunc, KeyInfo } from '../common/common';
|
||||
export declare function loadMessageBundle(_file?: string): (key: string | number | LocalizeInfo, message: string, ...args: any[]) => string;
|
||||
export declare function config(options?: Options): typeof loadMessageBundle;
|
||||
//# sourceMappingURL=main.d.ts.map
|
||||
1
node_modules/vscode-nls/lib/browser/main.d.ts.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/browser/main.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/browser/main.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEvH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,SACzB,MAAM,GAAG,MAAM,GAAG,YAAY,WAAW,MAAM,WAAW,GAAG,EAAE,KAAG,MAAM,CAO9F;AAED,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO,4BAGvC"}
|
||||
47
node_modules/vscode-nls/lib/browser/main.js
generated
vendored
Normal file
47
node_modules/vscode-nls/lib/browser/main.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
* ------------------------------------------------------------------------------------------ */
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.config = exports.loadMessageBundle = exports.BundleFormat = exports.MessageFormat = void 0;
|
||||
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; } });
|
||||
function loadMessageBundle(_file) {
|
||||
return function (key, message) {
|
||||
var args = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
args[_i - 2] = arguments[_i];
|
||||
}
|
||||
if (typeof key === 'number') {
|
||||
throw new Error("Browser implementation does currently not support externalized strings.");
|
||||
}
|
||||
else {
|
||||
return common_1.localize.apply(void 0, __spreadArray([key, message], args, false));
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.loadMessageBundle = loadMessageBundle;
|
||||
function config(options) {
|
||||
var _a;
|
||||
(0, common_1.setPseudo)(((_a = options === null || options === void 0 ? void 0 : options.locale) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === '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/browser/main.js.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/browser/main.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/browser/main.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;AAEhG,qCAAgC;AAEhC,2CAA8E;AAE9E,2CAAuH;AAA9G,uGAAA,aAAa,OAAA;AAAE,sGAAA,YAAY,OAAA;AAEpC,SAAgB,iBAAiB,CAAC,KAAc;IAC/C,OAAO,UAAU,GAAmC,EAAE,OAAe;QAAE,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,6BAAc;;QACpF,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;SAC3F;aAAM;YACN,OAAO,iBAAQ,8BAAC,GAAG,EAAE,OAAO,GAAK,IAAI,UAAE;SACvC;IACF,CAAC,CAAC;AACH,CAAC;AARD,8CAQC;AAED,SAAgB,MAAM,CAAC,OAAiB;;IACvC,IAAA,kBAAS,EAAC,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,WAAW,EAAE,MAAK,QAAQ,CAAC,CAAC;IACvD,OAAO,iBAAiB,CAAC;AAC1B,CAAC;AAHD,wBAGC;AAED,aAAG,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAM;IAC9B,iBAAiB,EAAE,iBAAiB;IACpC,MAAM,EAAE,MAAM;CACd,CAAC,CAAC,CAAC"}
|
||||
1
node_modules/vscode-nls/lib/browser/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/browser/tsconfig.tsbuildinfo
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../common/common.d.ts","../common/ral.d.ts","../../src/browser/main.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},"ca318e19fce2e60cc2a7b38b1584aeb5e828f8052ca7dadffb678710e98487f6","5c7bb5997369b2266142d3df41da94dd31fe3a97b778f43971f3c951a51c0f71","dc93cac838493a491682fcea19cc810ecda949f0e910f1c9ad00dea0357ab120"],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":1,"outDir":"./","sourceMap":true,"stripInternal":true,"target":1},"fileIdsList":[[3],[3,4]],"referencedMap":[[4,1],[5,2]],"exportedModulesMap":[[4,1],[5,2]],"semanticDiagnosticsPerFile":[3,4,2,1,5]},"version":"4.5.5"}
|
||||
70
node_modules/vscode-nls/lib/common/common.d.ts
generated
vendored
Normal file
70
node_modules/vscode-nls/lib/common/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
export declare enum MessageFormat {
|
||||
file = "file",
|
||||
bundle = "bundle",
|
||||
both = "both"
|
||||
}
|
||||
export declare enum BundleFormat {
|
||||
standalone = "standalone",
|
||||
languagePack = "languagePack"
|
||||
}
|
||||
export interface Options {
|
||||
locale?: string;
|
||||
cacheLanguageResolution?: boolean;
|
||||
messageFormat?: MessageFormat;
|
||||
bundleFormat?: BundleFormat;
|
||||
}
|
||||
export interface LocalizeInfo {
|
||||
key: string;
|
||||
comment: string[];
|
||||
}
|
||||
export interface LocalizeFunc {
|
||||
(info: LocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
||||
(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string;
|
||||
}
|
||||
export interface LoadFunc {
|
||||
(file?: string): LocalizeFunc;
|
||||
}
|
||||
export declare type SingleFileJsonFormat = string[] | {
|
||||
messages: string[];
|
||||
keys: string[];
|
||||
};
|
||||
export interface NlsBundle {
|
||||
[key: string]: string[];
|
||||
}
|
||||
export declare type KeyInfo = string | LocalizeInfo;
|
||||
export interface MetaDataEntry {
|
||||
messages: string[];
|
||||
keys: KeyInfo[];
|
||||
}
|
||||
export interface MetadataHeader {
|
||||
id: string;
|
||||
type: string;
|
||||
hash: string;
|
||||
outDir: string;
|
||||
}
|
||||
export interface MetaDataFile {
|
||||
[key: string]: MetaDataEntry;
|
||||
}
|
||||
export interface TranslationConfig {
|
||||
[extension: string]: string;
|
||||
}
|
||||
export interface I18nBundle {
|
||||
version: string;
|
||||
contents: {
|
||||
[module: string]: {
|
||||
[messageKey: string]: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export interface LanguageBundle {
|
||||
header: MetadataHeader;
|
||||
nlsBundle: NlsBundle;
|
||||
}
|
||||
export declare function isDefined(value: any): boolean;
|
||||
export declare let isPseudo: boolean;
|
||||
export declare function setPseudo(pseudo: boolean): void;
|
||||
export declare function format(message: string, args: any[]): string;
|
||||
export declare function localize(_key: string | LocalizeInfo, message: string, ...args: any[]): string;
|
||||
export declare function loadMessageBundle(file?: string): LocalizeFunc;
|
||||
export declare function config(opts?: Options): LoadFunc;
|
||||
//# sourceMappingURL=common.d.ts.map
|
||||
1
node_modules/vscode-nls/lib/common/common.d.ts.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/common/common.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common/common.ts"],"names":[],"mappings":"AAOA,oBAAY,aAAa;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CACb;AAED,oBAAY,YAAY;IAEvB,UAAU,eAAe;IACzB,YAAY,iBAAiB;CAC7B;AAED,MAAM,WAAW,OAAO;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AASD,MAAM,W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AC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;SAC7B,CAAC;KACF,CAAA;CACD;AAED,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE7C;AAED,eAAO,IAAI,QAAQ,SAAQ,CAAC;AAE5B,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,QAExC;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAwB3D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAE7F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAE7D;AAED,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAE/C"}
|
||||
80
node_modules/vscode-nls/lib/common/common.js
generated
vendored
Normal file
80
node_modules/vscode-nls/lib/common/common.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"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.localize = exports.format = exports.setPseudo = exports.isPseudo = exports.isDefined = exports.BundleFormat = exports.MessageFormat = void 0;
|
||||
var ral_1 = require("./ral");
|
||||
var MessageFormat;
|
||||
(function (MessageFormat) {
|
||||
MessageFormat["file"] = "file";
|
||||
MessageFormat["bundle"] = "bundle";
|
||||
MessageFormat["both"] = "both";
|
||||
})(MessageFormat = exports.MessageFormat || (exports.MessageFormat = {}));
|
||||
var BundleFormat;
|
||||
(function (BundleFormat) {
|
||||
// the nls.bundle format
|
||||
BundleFormat["standalone"] = "standalone";
|
||||
BundleFormat["languagePack"] = "languagePack";
|
||||
})(BundleFormat = exports.BundleFormat || (exports.BundleFormat = {}));
|
||||
var LocalizeInfo;
|
||||
(function (LocalizeInfo) {
|
||||
function is(value) {
|
||||
var candidate = value;
|
||||
return candidate && isDefined(candidate.key) && isDefined(candidate.comment);
|
||||
}
|
||||
LocalizeInfo.is = is;
|
||||
})(LocalizeInfo || (LocalizeInfo = {}));
|
||||
function isDefined(value) {
|
||||
return typeof value !== 'undefined';
|
||||
}
|
||||
exports.isDefined = isDefined;
|
||||
exports.isPseudo = false;
|
||||
function setPseudo(pseudo) {
|
||||
exports.isPseudo = pseudo;
|
||||
}
|
||||
exports.setPseudo = setPseudo;
|
||||
function format(message, args) {
|
||||
var result;
|
||||
if (exports.isPseudo) {
|
||||
// FF3B and FF3D is the Unicode zenkaku representation for [ and ]
|
||||
message = '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
||||
}
|
||||
if (args.length === 0) {
|
||||
result = message;
|
||||
}
|
||||
else {
|
||||
result = message.replace(/\{(\d+)\}/g, function (match, rest) {
|
||||
var index = rest[0];
|
||||
var arg = args[index];
|
||||
var replacement = match;
|
||||
if (typeof arg === 'string') {
|
||||
replacement = arg;
|
||||
}
|
||||
else if (typeof arg === 'number' || typeof arg === 'boolean' || arg === void 0 || arg === null) {
|
||||
replacement = String(arg);
|
||||
}
|
||||
return replacement;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.format = format;
|
||||
function localize(_key, message) {
|
||||
var args = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
args[_i - 2] = arguments[_i];
|
||||
}
|
||||
return format(message, args);
|
||||
}
|
||||
exports.localize = localize;
|
||||
function loadMessageBundle(file) {
|
||||
return (0, ral_1.default)().loadMessageBundle(file);
|
||||
}
|
||||
exports.loadMessageBundle = loadMessageBundle;
|
||||
function config(opts) {
|
||||
return (0, ral_1.default)().config(opts);
|
||||
}
|
||||
exports.config = config;
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
node_modules/vscode-nls/lib/common/common.js.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/common/common.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common/common.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6BAAwB;AAExB,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,8BAAa,CAAA;AACd,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,wBAAwB;IACxB,yCAAyB,CAAA;IACzB,6CAA6B,CAAA;AAC9B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAcD,IAAU,YAAY,CAKrB;AALD,WAAU,YAAY;IACrB,SAAgB,EAAE,CAAC,KAAU;QAC5B,IAAI,SAAS,GAAG,KAAqB,CAAC;QACtC,OAAO,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9E,CAAC;IAHe,eAAE,KAGjB,CAAA;AACF,CAAC,EALS,YAAY,KAAZ,YAAY,QAKrB;AAqDD,SAAgB,SAAS,CAAC,KAAU;IACnC,OAAO,OAAO,KAAK,KAAK,WAAW,CAAC;AACrC,CAAC;AAFD,8BAEC;AAEU,QAAA,QAAQ,GAAG,KAAK,CAAC;AAE5B,SAAgB,SAAS,CAAC,MAAe;IACxC,gBAAQ,GAAG,MAAM,CAAC;AACnB,CAAC;AAFD,8BAEC;AAED,SAAgB,MAAM,CAAC,OAAe,EAAE,IAAW;IAClD,I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C,IAAI,CAAC,CAAC;AAC3B,CAAC;AAFD,wBAEC"}
|
||||
11
node_modules/vscode-nls/lib/common/ral.d.ts
generated
vendored
Normal file
11
node_modules/vscode-nls/lib/common/ral.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import { LocalizeFunc, LoadFunc, Options } from './common';
|
||||
interface RAL {
|
||||
loadMessageBundle(file?: string): LocalizeFunc;
|
||||
config(opts?: Options): LoadFunc;
|
||||
}
|
||||
declare function RAL(): RAL;
|
||||
declare namespace RAL {
|
||||
function install(ral: RAL): void;
|
||||
}
|
||||
export default RAL;
|
||||
//# sourceMappingURL=ral.d.ts.map
|
||||
1
node_modules/vscode-nls/lib/common/ral.d.ts.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/common/ral.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ral.d.ts","sourceRoot":"","sources":["../../src/common/ral.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,GAAG;IACZ,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC/C,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CACjC;AAID,iBAAS,GAAG,IAAI,GAAG,CAKlB;AAED,kBAAU,GAAG,CAAC;IACb,SAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAKtC;CACD;AAED,eAAe,GAAG,CAAC"}
|
||||
20
node_modules/vscode-nls/lib/common/ral.js
generated
vendored
Normal file
20
node_modules/vscode-nls/lib/common/ral.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var _ral;
|
||||
function RAL() {
|
||||
if (_ral === undefined) {
|
||||
throw new Error("No runtime abstraction layer installed");
|
||||
}
|
||||
return _ral;
|
||||
}
|
||||
(function (RAL) {
|
||||
function install(ral) {
|
||||
if (ral === undefined) {
|
||||
throw new Error("No runtime abstraction layer provided");
|
||||
}
|
||||
_ral = ral;
|
||||
}
|
||||
RAL.install = install;
|
||||
})(RAL || (RAL = {}));
|
||||
exports.default = RAL;
|
||||
//# sourceMappingURL=ral.js.map
|
||||
1
node_modules/vscode-nls/lib/common/ral.js.map
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/common/ral.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ral.js","sourceRoot":"","sources":["../../src/common/ral.ts"],"names":[],"mappings":";;AAWA,IAAI,IAAqB,CAAC;AAE1B,SAAS,GAAG;IACX,IAAI,IAAI,KAAK,SAAS,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC1D;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,WAAU,GAAG;IACZ,SAAgB,OAAO,CAAC,GAAQ;QAC/B,IAAI,GAAG,KAAK,SAAS,EAAE;YACtB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;SACzD;QACD,IAAI,GAAG,GAAG,CAAC;IACZ,CAAC;IALe,WAAO,UAKtB,CAAA;AACF,CAAC,EAPS,GAAG,KAAH,GAAG,QAOZ;AAED,kBAAe,GAAG,CAAC"}
|
||||
1
node_modules/vscode-nls/lib/common/tsconfig.tsbuildinfo
generated
vendored
Normal file
1
node_modules/vscode-nls/lib/common/tsconfig.tsbuildinfo
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../src/common/ral.ts","../../src/common/common.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"6cf01409ba00e33f25d7e86de81e95441262ff1df750cbc4492f716fe8145f4d","a8b1279efd328bbedb3585152830e425b0be1b41be9b0e12844f0a0104c32636"],"options":{"composite":true,"declaration":true,"declarationMap":true,"module":1,"outDir":"./","sourceMap":true,"stripInternal":true,"target":1},"fileIdsList":[[2],[3]],"referencedMap":[[3,1],[2,2]],"exportedModulesMap":[[3,1],[2,2]],"semanticDiagnosticsPerFile":[1,3,2]},"version":"4.5.5"}
|
||||
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,E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,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACxD,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,sBAAsB,CAAC,CAAC;IAC/D,CAAC,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