@tolgee/core 4.8.6-rc.8439ca3.0 → 4.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Constants/Global.d.ts +0 -0
- package/dist/Constants/ModifierKey.d.ts +0 -0
- package/dist/Errors/ApiHttpError.d.ts +0 -0
- package/dist/Observer.d.ts +0 -0
- package/dist/Observer.test.d.ts +0 -0
- package/dist/Properties.d.ts +0 -0
- package/dist/Properties.test.d.ts +0 -0
- package/dist/Tolgee.d.ts +0 -0
- package/dist/Tolgee.test.d.ts +0 -0
- package/dist/TolgeeConfig.d.ts +0 -0
- package/dist/TolgeeConfig.test.d.ts +0 -0
- package/dist/__integration/FormatterIcu.test.d.ts +0 -0
- package/dist/__integration/FormatterMissing.d.ts +0 -0
- package/dist/__integration/Tolgee.test.d.ts +0 -0
- package/dist/__integration/TolgeeInvisible.test.d.ts +0 -0
- package/dist/__integration/mockTranslations.d.ts +0 -0
- package/dist/__integration/testConfig.d.ts +0 -0
- package/dist/__testFixtures/classMock.d.ts +0 -0
- package/dist/__testFixtures/createElement.d.ts +0 -0
- package/dist/__testFixtures/createTestDom.d.ts +0 -0
- package/dist/__testFixtures/mocked.d.ts +0 -0
- package/dist/__testFixtures/setupAfterEnv.d.ts +0 -0
- package/dist/helpers/NodeHelper.d.ts +0 -0
- package/dist/helpers/TextHelper.d.ts +0 -0
- package/dist/helpers/TextHelper.test.d.ts +0 -0
- package/dist/helpers/commonTypes.d.ts +0 -0
- package/dist/helpers/encoderPolyfill.d.ts +0 -0
- package/dist/helpers/secret.d.ts +0 -0
- package/dist/helpers/secret.test.d.ts +0 -0
- package/dist/helpers/sleep.d.ts +0 -0
- package/dist/highlighter/HighlightFunctionsInitializer.d.ts +0 -0
- package/dist/highlighter/HighlightFunctionsInitializer.test.d.ts +0 -0
- package/dist/highlighter/MouseEventHandler.d.ts +0 -0
- package/dist/highlighter/MouseEventHandler.test.d.ts +0 -0
- package/dist/highlighter/TranslationHighlighter.d.ts +0 -0
- package/dist/highlighter/TranslationHighlighter.test.d.ts +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/internal.d.ts +0 -0
- package/dist/modules/IcuFormatter.d.ts +0 -0
- package/dist/modules/IcuFormatter.test.d.ts +1 -0
- package/dist/modules/index.d.ts +0 -0
- package/dist/services/ApiHttpService.d.ts +0 -0
- package/dist/services/CoreService.d.ts +0 -0
- package/dist/services/CoreService.test.d.ts +0 -0
- package/dist/services/DependencyService.d.ts +0 -0
- package/dist/services/DependencyService.test.d.ts +0 -0
- package/dist/services/ElementRegistrar.d.ts +0 -0
- package/dist/services/ElementRegistrar.test.d.ts +0 -0
- package/dist/services/EventEmitter.d.ts +0 -0
- package/dist/services/EventService.d.ts +0 -0
- package/dist/services/ModuleService.d.ts +0 -0
- package/dist/services/ScreenshotService.d.ts +0 -0
- package/dist/services/Subscription.d.ts +0 -0
- package/dist/services/TextService.d.ts +0 -0
- package/dist/services/TextService.test.d.ts +0 -0
- package/dist/services/TranslationService.d.ts +0 -0
- package/dist/services/TranslationService.test.d.ts +0 -0
- package/dist/services/__mocks__/CoreService.d.ts +0 -0
- package/dist/tolgee.cjs.js +23 -3
- package/dist/tolgee.cjs.js.map +1 -1
- package/dist/tolgee.cjs.min.js +1 -1
- package/dist/tolgee.cjs.min.js.map +1 -1
- package/dist/tolgee.esm.min.mjs +1 -1
- package/dist/tolgee.esm.min.mjs.map +1 -1
- package/dist/tolgee.esm.mjs +23 -3
- package/dist/tolgee.esm.mjs.map +1 -1
- package/dist/tolgee.umd.js +23 -3
- package/dist/tolgee.umd.js.map +1 -1
- package/dist/tolgee.umd.min.js +1 -1
- package/dist/tolgee.umd.min.js.map +1 -1
- package/dist/toolsManager/Messages.d.ts +0 -0
- package/dist/toolsManager/Messages.test.d.ts +0 -0
- package/dist/toolsManager/PluginManager.d.ts +0 -0
- package/dist/toolsManager/PluginManager.test.d.ts +0 -0
- package/dist/types/DTOs.d.ts +0 -0
- package/dist/types/apiSchema.generated.d.ts +0 -0
- package/dist/types.d.ts +0 -0
- package/dist/wrappers/AbstractWrapper.d.ts +0 -0
- package/dist/wrappers/NodeHandler.d.ts +0 -0
- package/dist/wrappers/WrappedHandler.d.ts +0 -0
- package/dist/wrappers/invisible/AttributeHandler.d.ts +0 -0
- package/dist/wrappers/invisible/Coder.d.ts +0 -0
- package/dist/wrappers/invisible/ContentHandler.d.ts +0 -0
- package/dist/wrappers/invisible/CoreHandler.d.ts +0 -0
- package/dist/wrappers/invisible/InvisibleWrapper.d.ts +0 -0
- package/dist/wrappers/invisible/ValueMemory.d.ts +0 -0
- package/dist/wrappers/invisible/ValueMemory.test.d.ts +0 -0
- package/dist/wrappers/text/AttributeHandler.d.ts +0 -0
- package/dist/wrappers/text/AttributeHandler.test.d.ts +0 -0
- package/dist/wrappers/text/Coder.d.ts +0 -0
- package/dist/wrappers/text/Coder.test.d.ts +0 -0
- package/dist/wrappers/text/ContentHandler.d.ts +0 -0
- package/dist/wrappers/text/ContentHandler.test.d.ts +0 -0
- package/dist/wrappers/text/CoreHandler.d.ts +0 -0
- package/dist/wrappers/text/CoreHandler.test.d.ts +0 -0
- package/dist/wrappers/text/TextWrapper.d.ts +0 -0
- package/lib/Constants/Global.d.ts +0 -0
- package/lib/Constants/ModifierKey.d.ts +0 -0
- package/lib/Errors/ApiHttpError.d.ts +0 -0
- package/lib/Observer.d.ts +0 -0
- package/lib/Properties.d.ts +0 -0
- package/lib/Tolgee.d.ts +0 -0
- package/lib/TolgeeConfig.d.ts +0 -0
- package/lib/helpers/NodeHelper.d.ts +0 -0
- package/lib/helpers/TextHelper.d.ts +0 -0
- package/lib/helpers/commonTypes.d.ts +0 -0
- package/lib/helpers/encoderPolyfill.d.ts +0 -0
- package/lib/helpers/secret.d.ts +0 -0
- package/lib/helpers/sleep.d.ts +0 -0
- package/lib/highlighter/HighlightFunctionsInitializer.d.ts +0 -0
- package/lib/highlighter/MouseEventHandler.d.ts +0 -0
- package/lib/highlighter/TranslationHighlighter.d.ts +0 -0
- package/lib/index.d.ts +0 -0
- package/lib/modules/IcuFormatter.d.ts +0 -0
- package/lib/modules/index.d.ts +0 -0
- package/lib/services/ApiHttpService.d.ts +0 -0
- package/lib/services/CoreService.d.ts +0 -0
- package/lib/services/DependencyService.d.ts +0 -0
- package/lib/services/ElementRegistrar.d.ts +0 -0
- package/lib/services/EventEmitter.d.ts +0 -0
- package/lib/services/EventService.d.ts +0 -0
- package/lib/services/ModuleService.d.ts +0 -0
- package/lib/services/ScreenshotService.d.ts +0 -0
- package/lib/services/Subscription.d.ts +0 -0
- package/lib/services/TextService.d.ts +0 -0
- package/lib/services/TranslationService.d.ts +0 -0
- package/lib/toolsManager/Messages.d.ts +0 -0
- package/lib/toolsManager/PluginManager.d.ts +0 -0
- package/lib/types/DTOs.d.ts +0 -0
- package/lib/types/apiSchema.generated.d.ts +0 -0
- package/lib/types.d.ts +0 -0
- package/lib/wrappers/AbstractWrapper.d.ts +0 -0
- package/lib/wrappers/NodeHandler.d.ts +0 -0
- package/lib/wrappers/WrappedHandler.d.ts +0 -0
- package/lib/wrappers/invisible/AttributeHandler.d.ts +0 -0
- package/lib/wrappers/invisible/Coder.d.ts +0 -0
- package/lib/wrappers/invisible/ContentHandler.d.ts +0 -0
- package/lib/wrappers/invisible/CoreHandler.d.ts +0 -0
- package/lib/wrappers/invisible/InvisibleWrapper.d.ts +0 -0
- package/lib/wrappers/invisible/ValueMemory.d.ts +0 -0
- package/lib/wrappers/text/AttributeHandler.d.ts +0 -0
- package/lib/wrappers/text/Coder.d.ts +0 -0
- package/lib/wrappers/text/ContentHandler.d.ts +0 -0
- package/lib/wrappers/text/CoreHandler.d.ts +0 -0
- package/lib/wrappers/text/TextWrapper.d.ts +0 -0
- package/package.json +2 -2
- package/src/modules/IcuFormatter.test.ts +21 -0
- package/src/modules/IcuFormatter.ts +24 -2
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/Observer.d.ts
CHANGED
|
File without changes
|
package/dist/Observer.test.d.ts
CHANGED
|
File without changes
|
package/dist/Properties.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/Tolgee.d.ts
CHANGED
|
File without changes
|
package/dist/Tolgee.test.d.ts
CHANGED
|
File without changes
|
package/dist/TolgeeConfig.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/helpers/secret.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/helpers/sleep.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/internal.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/modules/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/tolgee.cjs.js
CHANGED
|
@@ -1791,7 +1791,7 @@ var PluginManager = /** @class */ (function () {
|
|
|
1791
1791
|
this.handshake = function () {
|
|
1792
1792
|
var sharedConfiguration = __assign(__assign({}, _this.properties), { config: __assign(__assign({}, _this.properties.config), {
|
|
1793
1793
|
//remove properties, which cannot be sent by window.postMessage
|
|
1794
|
-
staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "4.
|
|
1794
|
+
staticData: undefined, targetElement: undefined, _targetElement: undefined, ui: undefined }), uiPresent: Boolean(_this.properties.config.ui), uiVersion: "4.9.2" });
|
|
1795
1795
|
var timer = null;
|
|
1796
1796
|
var ping = function () {
|
|
1797
1797
|
_this.messages.send('TOLGEE_READY', sharedConfiguration);
|
|
@@ -7116,12 +7116,32 @@ var IntlMessageFormat = IntlMessageFormat$1;
|
|
|
7116
7116
|
var _a;
|
|
7117
7117
|
var IcuFormatter = (_a = /** @class */ (function () {
|
|
7118
7118
|
function class_1() {
|
|
7119
|
-
this.
|
|
7119
|
+
this.locales = new Map();
|
|
7120
7120
|
}
|
|
7121
|
+
class_1.prototype.isLocaleValid = function (locale) {
|
|
7122
|
+
try {
|
|
7123
|
+
return Boolean(Intl.NumberFormat.supportedLocalesOf(locale).length);
|
|
7124
|
+
}
|
|
7125
|
+
catch (_a) {
|
|
7126
|
+
return false;
|
|
7127
|
+
}
|
|
7128
|
+
};
|
|
7129
|
+
class_1.prototype.getLocale = function (language) {
|
|
7130
|
+
if (!this.locales.get(language)) {
|
|
7131
|
+
var localeCandidate = String(language).replace(/[^a-zA-Z]/g, '-');
|
|
7132
|
+
while (!this.isLocaleValid(localeCandidate)) {
|
|
7133
|
+
localeCandidate =
|
|
7134
|
+
localeCandidate.split('-').slice(0, -1).join('-') || 'en';
|
|
7135
|
+
}
|
|
7136
|
+
this.locales.set(language, localeCandidate);
|
|
7137
|
+
}
|
|
7138
|
+
return this.locales.get(language);
|
|
7139
|
+
};
|
|
7121
7140
|
class_1.prototype.format = function (_a) {
|
|
7122
7141
|
var translation = _a.translation, language = _a.language, params = _a.params;
|
|
7123
7142
|
var ignoreTag = !Object.values(params).find(function (p) { return typeof p === 'function'; });
|
|
7124
|
-
|
|
7143
|
+
var locale = this.getLocale(language);
|
|
7144
|
+
return new IntlMessageFormat(translation, locale, undefined, {
|
|
7125
7145
|
ignoreTag: ignoreTag,
|
|
7126
7146
|
}).format(params);
|
|
7127
7147
|
};
|