@superset-ui/translation
Advanced tools
Comparing version 0.12.21 to 0.13.0
@@ -1,23 +0,2 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
var _exportNames = { | ||
configure: true, | ||
t: true, | ||
tn: true | ||
}; | ||
exports.tn = exports.t = exports.configure = void 0; | ||
var _TranslatorSingleton = require("./TranslatorSingleton"); | ||
exports.configure = _TranslatorSingleton.configure; | ||
exports.t = _TranslatorSingleton.t; | ||
exports.tn = _TranslatorSingleton.tn; | ||
var _types = require("./types"); | ||
Object.keys(_types).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; | ||
exports[key] = _types[key]; | ||
}); | ||
export { configure, t, tn } from './TranslatorSingleton'; | ||
export * from './types'; |
@@ -1,12 +0,4 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.default = void 0; | ||
var _jed = _interopRequireDefault(require("jed")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
import UntypedJed from 'jed'; | ||
const DEFAULT_LANGUAGE_PACK = { | ||
@@ -24,4 +16,3 @@ domain: 'superset', | ||
}; | ||
class Translator { | ||
export default class Translator { | ||
constructor(config = {}) { | ||
@@ -33,3 +24,3 @@ _defineProperty(this, "i18n", void 0); | ||
} = config; | ||
this.i18n = new _jed.default(languagePack); | ||
this.i18n = new UntypedJed(languagePack); | ||
} | ||
@@ -45,4 +36,2 @@ | ||
} | ||
exports.default = Translator; | ||
} |
@@ -1,13 +0,3 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
exports.configure = configure; | ||
exports.t = t; | ||
exports.tn = tn; | ||
var _Translator = _interopRequireDefault(require("./Translator")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* eslint no-console: 0 */ | ||
import Translator from './Translator'; | ||
let singleton; | ||
@@ -17,3 +7,3 @@ let isConfigured = false; | ||
function configure(config) { | ||
singleton = new _Translator.default(config); | ||
singleton = new Translator(config); | ||
isConfigured = true; | ||
@@ -29,3 +19,3 @@ return singleton; | ||
if (typeof singleton === 'undefined') { | ||
singleton = new _Translator.default(); | ||
singleton = new Translator(); | ||
} | ||
@@ -42,2 +32,4 @@ | ||
return getInstance().translateWithNumber(singular, plural, ...args); | ||
} | ||
} | ||
export { configure, t, tn }; |
{ | ||
"name": "@superset-ui/translation", | ||
"version": "0.12.21", | ||
"version": "0.13.0", | ||
"description": "Superset UI translation", | ||
@@ -34,3 +34,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "fb9cce364fa6046e774d76dda07947be62347c2f" | ||
"gitHead": "72b0c99f843add947371c6ee45cc32d57db6b027" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19643
143