main.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. /* --------------------------------------------------------------------------------------------
  3. * Copyright (c) Microsoft Corporation. All rights reserved.
  4. * Licensed under the MIT License. See License.txt in the project root for license information.
  5. * ------------------------------------------------------------------------------------------ */
  6. var __spreadArrays = (this && this.__spreadArrays) || function () {
  7. for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  8. for (var r = Array(s), k = 0, i = 0; i < il; i++)
  9. for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
  10. r[k] = a[j];
  11. return r;
  12. };
  13. Object.defineProperty(exports, "__esModule", { value: true });
  14. exports.config = exports.loadMessageBundle = void 0;
  15. var ral_1 = require("../common/ral");
  16. var common_1 = require("../common/common");
  17. var common_2 = require("../common/common");
  18. Object.defineProperty(exports, "MessageFormat", { enumerable: true, get: function () { return common_2.MessageFormat; } });
  19. Object.defineProperty(exports, "BundleFormat", { enumerable: true, get: function () { return common_2.BundleFormat; } });
  20. function loadMessageBundle(_file) {
  21. return function (key, message) {
  22. var args = [];
  23. for (var _i = 2; _i < arguments.length; _i++) {
  24. args[_i - 2] = arguments[_i];
  25. }
  26. if (typeof key === 'number') {
  27. throw new Error("Browser implementation does currently not support externalized strings.");
  28. }
  29. else {
  30. return common_1.localize.apply(void 0, __spreadArrays([key, message], args));
  31. }
  32. };
  33. }
  34. exports.loadMessageBundle = loadMessageBundle;
  35. function config(options) {
  36. common_1.setPseudo((options === null || options === void 0 ? void 0 : options.locale.toLowerCase()) === 'pseudo');
  37. return loadMessageBundle;
  38. }
  39. exports.config = config;
  40. ral_1.default.install(Object.freeze({
  41. loadMessageBundle: loadMessageBundle,
  42. config: config
  43. }));
  44. //# sourceMappingURL=main.js.map