@tolgee/i18next
Advanced tools
Comparing version 4.10.0-rc.578d1d0.0 to 4.10.0-rc.66ab647.0
@@ -1,4 +0,2 @@ | ||
import { TolgeePlugin, ObserverOptions } from '@tolgee/web'; | ||
declare type Props = Partial<ObserverOptions>; | ||
export declare const I18nextPlugin: (props?: Props) => TolgeePlugin; | ||
export {}; | ||
import { TolgeePlugin } from '@tolgee/web'; | ||
export declare const I18nextPlugin: () => TolgeePlugin; |
@@ -5,3 +5,4 @@ export * from './withTolgee'; | ||
export * from './tolgeeBackend'; | ||
export * from './tolgeeProcessor'; | ||
export * from './I18nextPlugin'; | ||
export * from '@tolgee/web'; |
@@ -217,15 +217,12 @@ 'use strict'; | ||
var I18nextPlugin = function (props) { | ||
return function (tolgee) { | ||
return tolgee | ||
.use(web.BrowserExtensionPlugin()) | ||
.use(web.DevTools({ observer: props })) | ||
.init({ ns: [] }); | ||
}; | ||
}; | ||
var I18nextPlugin = function () { return function (tolgee) { | ||
return tolgee.use(web.BrowserExtensionPlugin()).use(web.DevTools()).init({ ns: [] }); | ||
}; }; | ||
exports.I18nextPlugin = I18nextPlugin; | ||
exports.TOLGEE_PROCESSOR_NAME = TOLGEE_PROCESSOR_NAME; | ||
exports.tolgeeApply = tolgeeApply; | ||
exports.tolgeeBackend = tolgeeBackend; | ||
exports.tolgeeOptions = tolgeeOptions; | ||
exports.tolgeeProcessor = tolgeeProcessor; | ||
exports.withTolgee = withTolgee; | ||
@@ -232,0 +229,0 @@ Object.keys(web).forEach(function (k) { |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@tolgee/web"),n=function(e,n){e.onKeyUpdate((function(){e.getAllRecords().forEach((function(e){var r=e.language,t=e.namespace,o=e.data,a=t||"translation";n.removeResourceBundle(r,a),n.addResources(r,a,Object.fromEntries(o))}))})),n.on("languageChanged",(function(n){n&&e.getLanguage()!==n&&e.changeLanguage(n)})),n.tolgee=e},r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r,t){return new(r||(r=Promise))((function(o,a){function u(e){try{c(t.next(e))}catch(e){a(e)}}function i(e){try{c(t.throw(e))}catch(e){a(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(u,i)}c((t=t.apply(e,n||[])).next())}))}function o(e,n){var r,t,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,t=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(e,u)}catch(e){a=[6,e],t=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function a(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var u=function(e){return{type:"backend",name:"TolgeeBackend",init:function(){},read:function(n,r,a){return t(this,void 0,void 0,(function(){var t,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.loadRecord({language:n,namespace:"translation"===r?"":void 0})];case 1:return t=o.sent(),a(null,Object.fromEntries(t)),[3,3];case 2:return u=o.sent(),console.error(u),a(!0),[3,3];case 3:return[2]}}))}))}}},i=function(e,n){var t,o,u;return u="string"==typeof n.postProcess?[n.postProcess,"tolgeeProcessor"]:Array.isArray(n.postProcess)?a(a([],function(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,a=r.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(t=a.next()).done;)u.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u}(n.postProcess),!1),["tolgeeProcessor"],!1):["tolgeeProcessor"],r(r({},n),{postProcess:u,i18nFormat:r(r({},null==n?void 0:n.i18nFormat),{bindI18nStore:"added "+(null===(t=n.i18nFormat)||void 0===t?void 0:t.bindI18nStore)||""}),react:r(r({},null==n?void 0:n.react),{bindI18nStore:"added "+(null===(o=n.react)||void 0===o?void 0:o.bindI18nStore)||""})})};exports.I18nextPlugin=function(n){return function(r){return r.use(e.BrowserExtensionPlugin()).use(e.DevTools({observer:n})).init({ns:[]})}},exports.tolgeeApply=n,exports.tolgeeBackend=u,exports.tolgeeOptions=i,exports.withTolgee=function(e,r){e.use(u(r)),e.use(function(e){return{type:"postProcessor",name:"tolgeeProcessor",process:function(n,r,t){return e.wrap({key:r.join("."),defaultValue:t.defaultValue,translation:n})}}}(r));var t=e.init;return e.init=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n(r,e);var u={},c=void 0;"object"==typeof o[0]?(u=o[0],c=o[1]):c=o[0];var l=i(0,u),s=t(l,c),f=e.language||u.lng;return f&&r.changeLanguage(f),r.run(),s},e},Object.keys(e).forEach((function(n){"default"===n||exports.hasOwnProperty(n)||Object.defineProperty(exports,n,{enumerable:!0,get:function(){return e[n]}})})); | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@tolgee/web"),n=function(e,n){e.onKeyUpdate((function(){e.getAllRecords().forEach((function(e){var r=e.language,t=e.namespace,o=e.data,a=t||"translation";n.removeResourceBundle(r,a),n.addResources(r,a,Object.fromEntries(o))}))})),n.on("languageChanged",(function(n){n&&e.getLanguage()!==n&&e.changeLanguage(n)})),n.tolgee=e},r=function(){return r=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function t(e,n,r,t){return new(r||(r=Promise))((function(o,a){function u(e){try{c(t.next(e))}catch(e){a(e)}}function i(e){try{c(t.throw(e))}catch(e){a(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(u,i)}c((t=t.apply(e,n||[])).next())}))}function o(e,n){var r,t,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,t=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=n.call(e,u)}catch(e){a=[6,e],t=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function a(e,n,r){if(r||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}var u=function(e){return{type:"backend",name:"TolgeeBackend",init:function(){},read:function(n,r,a){return t(this,void 0,void 0,(function(){var t,u;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.loadRecord({language:n,namespace:"translation"===r?"":void 0})];case 1:return t=o.sent(),a(null,Object.fromEntries(t)),[3,3];case 2:return u=o.sent(),console.error(u),a(!0),[3,3];case 3:return[2]}}))}))}}},i=function(e){return{type:"postProcessor",name:"tolgeeProcessor",process:function(n,r,t){return e.wrap({key:r.join("."),defaultValue:t.defaultValue,translation:n})}}},c=function(e,n){var t,o,u;return u="string"==typeof n.postProcess?[n.postProcess,"tolgeeProcessor"]:Array.isArray(n.postProcess)?a(a([],function(e,n){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var t,o,a=r.call(e),u=[];try{for(;(void 0===n||n-- >0)&&!(t=a.next()).done;)u.push(t.value)}catch(e){o={error:e}}finally{try{t&&!t.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return u}(n.postProcess),!1),["tolgeeProcessor"],!1):["tolgeeProcessor"],r(r({},n),{postProcess:u,i18nFormat:r(r({},null==n?void 0:n.i18nFormat),{bindI18nStore:"added "+(null===(t=n.i18nFormat)||void 0===t?void 0:t.bindI18nStore)||""}),react:r(r({},null==n?void 0:n.react),{bindI18nStore:"added "+(null===(o=n.react)||void 0===o?void 0:o.bindI18nStore)||""})})};exports.I18nextPlugin=function(){return function(n){return n.use(e.BrowserExtensionPlugin()).use(e.DevTools()).init({ns:[]})}},exports.TOLGEE_PROCESSOR_NAME="tolgeeProcessor",exports.tolgeeApply=n,exports.tolgeeBackend=u,exports.tolgeeOptions=c,exports.tolgeeProcessor=i,exports.withTolgee=function(e,r){e.use(u(r)),e.use(i(r));var t=e.init;return e.init=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];n(r,e);var u={},i=void 0;"object"==typeof o[0]?(u=o[0],i=o[1]):i=o[0];var l=c(0,u),s=t(l,i),f=e.language||u.lng;return f&&r.changeLanguage(f),r.run(),s},e},Object.keys(e).forEach((function(n){"default"===n||exports.hasOwnProperty(n)||Object.defineProperty(exports,n,{enumerable:!0,get:function(){return e[n]}})})); | ||
//# sourceMappingURL=tolgee-i18next.cjs.min.js.map |
@@ -214,12 +214,7 @@ import { BrowserExtensionPlugin, DevTools } from '@tolgee/web'; | ||
var I18nextPlugin = function (props) { | ||
return function (tolgee) { | ||
return tolgee | ||
.use(BrowserExtensionPlugin()) | ||
.use(DevTools({ observer: props })) | ||
.init({ ns: [] }); | ||
}; | ||
}; | ||
var I18nextPlugin = function () { return function (tolgee) { | ||
return tolgee.use(BrowserExtensionPlugin()).use(DevTools()).init({ ns: [] }); | ||
}; }; | ||
export { I18nextPlugin, tolgeeApply, tolgeeBackend, tolgeeOptions, withTolgee }; | ||
export { I18nextPlugin, TOLGEE_PROCESSOR_NAME, tolgeeApply, tolgeeBackend, tolgeeOptions, tolgeeProcessor, withTolgee }; | ||
//# sourceMappingURL=tolgee-i18next.esm.js.map |
@@ -217,15 +217,12 @@ (function (global, factory) { | ||
var I18nextPlugin = function (props) { | ||
return function (tolgee) { | ||
return tolgee | ||
.use(web.BrowserExtensionPlugin()) | ||
.use(web.DevTools({ observer: props })) | ||
.init({ ns: [] }); | ||
}; | ||
}; | ||
var I18nextPlugin = function () { return function (tolgee) { | ||
return tolgee.use(web.BrowserExtensionPlugin()).use(web.DevTools()).init({ ns: [] }); | ||
}; }; | ||
exports.I18nextPlugin = I18nextPlugin; | ||
exports.TOLGEE_PROCESSOR_NAME = TOLGEE_PROCESSOR_NAME; | ||
exports.tolgeeApply = tolgeeApply; | ||
exports.tolgeeBackend = tolgeeBackend; | ||
exports.tolgeeOptions = tolgeeOptions; | ||
exports.tolgeeProcessor = tolgeeProcessor; | ||
exports.withTolgee = withTolgee; | ||
@@ -232,0 +229,0 @@ Object.keys(web).forEach(function (k) { |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@tolgee/web")):"function"==typeof define&&define.amd?define(["exports","@tolgee/web"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/i18next"]={},e["@tolgee/web"])}(this,(function(e,n){"use strict";var t=function(e,n){e.onKeyUpdate((function(){e.getAllRecords().forEach((function(e){var t=e.language,r=e.namespace,o=e.data,a=r||"translation";n.removeResourceBundle(t,a),n.addResources(t,a,Object.fromEntries(o))}))})),n.on("languageChanged",(function(n){n&&e.getLanguage()!==n&&e.changeLanguage(n)})),n.tolgee=e},r=function(){return r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function o(e,n,t,r){return new(t||(t=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,u)}l((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=n.call(e,i)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var u=function(e){return{type:"backend",name:"TolgeeBackend",init:function(){},read:function(n,t,r){return o(this,void 0,void 0,(function(){var o,i;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e.loadRecord({language:n,namespace:"translation"===t?"":void 0})];case 1:return o=a.sent(),r(null,Object.fromEntries(o)),[3,3];case 2:return i=a.sent(),console.error(i),r(!0),[3,3];case 3:return[2]}}))}))}}},l="tolgeeProcessor",c=function(e,n){var t,o,a;return a="string"==typeof n.postProcess?[n.postProcess,l]:Array.isArray(n.postProcess)?i(i([],function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,a=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return i}(n.postProcess),!1),[l],!1):[l],r(r({},n),{postProcess:a,i18nFormat:r(r({},null==n?void 0:n.i18nFormat),{bindI18nStore:"added "+(null===(t=n.i18nFormat)||void 0===t?void 0:t.bindI18nStore)||""}),react:r(r({},null==n?void 0:n.react),{bindI18nStore:"added "+(null===(o=n.react)||void 0===o?void 0:o.bindI18nStore)||""})})};e.I18nextPlugin=function(e){return function(t){return t.use(n.BrowserExtensionPlugin()).use(n.DevTools({observer:e})).init({ns:[]})}},e.tolgeeApply=t,e.tolgeeBackend=u,e.tolgeeOptions=c,e.withTolgee=function(e,n){e.use(u(n)),e.use(function(e){return{type:"postProcessor",name:"tolgeeProcessor",process:function(n,t,r){return e.wrap({key:t.join("."),defaultValue:r.defaultValue,translation:n})}}}(n));var r=e.init;return e.init=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];t(n,e);var i={},u=void 0;"object"==typeof o[0]?(i=o[0],u=o[1]):u=o[0];var l=c(0,i),s=r(l,u),f=e.language||i.lng;return f&&n.changeLanguage(f),n.run(),s},e},Object.keys(n).forEach((function(t){"default"===t||e.hasOwnProperty(t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@tolgee/web")):"function"==typeof define&&define.amd?define(["exports","@tolgee/web"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@tolgee/i18next"]={},e["@tolgee/web"])}(this,(function(e,n){"use strict";var t=function(e,n){e.onKeyUpdate((function(){e.getAllRecords().forEach((function(e){var t=e.language,r=e.namespace,o=e.data,a=r||"translation";n.removeResourceBundle(t,a),n.addResources(t,a,Object.fromEntries(o))}))})),n.on("languageChanged",(function(n){n&&e.getLanguage()!==n&&e.changeLanguage(n)})),n.tolgee=e},r=function(){return r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},r.apply(this,arguments)};function o(e,n,t,r){return new(t||(t=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,u)}l((r=r.apply(e,n||[])).next())}))}function a(e,n){var t,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=n.call(e,i)}catch(e){a=[6,e],r=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var u=function(e){return{type:"backend",name:"TolgeeBackend",init:function(){},read:function(n,t,r){return o(this,void 0,void 0,(function(){var o,i;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e.loadRecord({language:n,namespace:"translation"===t?"":void 0})];case 1:return o=a.sent(),r(null,Object.fromEntries(o)),[3,3];case 2:return i=a.sent(),console.error(i),r(!0),[3,3];case 3:return[2]}}))}))}}},l="tolgeeProcessor",c=function(e){return{type:"postProcessor",name:"tolgeeProcessor",process:function(n,t,r){return e.wrap({key:t.join("."),defaultValue:r.defaultValue,translation:n})}}},s=function(e,n){var t,o,a;return a="string"==typeof n.postProcess?[n.postProcess,l]:Array.isArray(n.postProcess)?i(i([],function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var r,o,a=t.call(e),i=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return i}(n.postProcess),!1),[l],!1):[l],r(r({},n),{postProcess:a,i18nFormat:r(r({},null==n?void 0:n.i18nFormat),{bindI18nStore:"added "+(null===(t=n.i18nFormat)||void 0===t?void 0:t.bindI18nStore)||""}),react:r(r({},null==n?void 0:n.react),{bindI18nStore:"added "+(null===(o=n.react)||void 0===o?void 0:o.bindI18nStore)||""})})};e.I18nextPlugin=function(){return function(e){return e.use(n.BrowserExtensionPlugin()).use(n.DevTools()).init({ns:[]})}},e.TOLGEE_PROCESSOR_NAME=l,e.tolgeeApply=t,e.tolgeeBackend=u,e.tolgeeOptions=s,e.tolgeeProcessor=c,e.withTolgee=function(e,n){e.use(u(n)),e.use(c(n));var r=e.init;return e.init=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];t(n,e);var i={},u=void 0;"object"==typeof o[0]?(i=o[0],u=o[1]):u=o[0];var l=s(0,i),c=r(l,u),f=e.language||i.lng;return f&&n.changeLanguage(f),n.run(),c},e},Object.keys(n).forEach((function(t){"default"===t||e.hasOwnProperty(t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=tolgee-i18next.umd.min.js.map |
@@ -34,3 +34,3 @@ import { TolgeeInstance } from '@tolgee/web'; | ||
ns?: string | readonly string[]; | ||
defaultNS?: string; | ||
defaultNS?: string | false | readonly string[]; | ||
fallbackNS?: string | false | readonly string[]; | ||
@@ -62,17 +62,3 @@ saveMissing?: boolean; | ||
appendNamespaceToCIMode?: boolean; | ||
compatibilityJSON?: "v1" | "v2" | "v3"; | ||
editor?: { | ||
enabled?: boolean; | ||
autoOpen?: boolean; | ||
enableByQS?: string | false; | ||
toggleKeyModifier?: "ctrlKey" | "metaKey" | "altKey" | "shiftKey"; | ||
toggleKeyCode?: number; | ||
lngOverrideQS?: string; | ||
lngOverride?: string; | ||
mode?: "iframe" | "window"; | ||
iframeContainerStyle?: string; | ||
iframeStyle?: string; | ||
bodyStyle?: string; | ||
onEditorSaved?: (lng: null, ns: string | readonly string[]) => void; | ||
}; | ||
compatibilityJSON?: "v1" | "v2" | "v3" | "v4"; | ||
locizeLastUsed?: { | ||
@@ -88,2 +74,4 @@ projectId: string; | ||
maxParallelReads?: number; | ||
maxRetries?: number; | ||
retryTimeout?: number; | ||
backend?: object; | ||
@@ -90,0 +78,0 @@ detection?: object; |
@@ -1,4 +0,2 @@ | ||
import { TolgeePlugin, ObserverOptions } from '@tolgee/web'; | ||
declare type Props = Partial<ObserverOptions>; | ||
export declare const I18nextPlugin: (props?: Props) => TolgeePlugin; | ||
export {}; | ||
import { TolgeePlugin } from '@tolgee/web'; | ||
export declare const I18nextPlugin: () => TolgeePlugin; |
@@ -5,3 +5,4 @@ export * from './withTolgee'; | ||
export * from './tolgeeBackend'; | ||
export * from './tolgeeProcessor'; | ||
export * from './I18nextPlugin'; | ||
export * from '@tolgee/web'; |
@@ -34,3 +34,3 @@ import { TolgeeInstance } from '@tolgee/web'; | ||
ns?: string | readonly string[]; | ||
defaultNS?: string; | ||
defaultNS?: string | false | readonly string[]; | ||
fallbackNS?: string | false | readonly string[]; | ||
@@ -62,17 +62,3 @@ saveMissing?: boolean; | ||
appendNamespaceToCIMode?: boolean; | ||
compatibilityJSON?: "v1" | "v2" | "v3"; | ||
editor?: { | ||
enabled?: boolean; | ||
autoOpen?: boolean; | ||
enableByQS?: string | false; | ||
toggleKeyModifier?: "ctrlKey" | "metaKey" | "altKey" | "shiftKey"; | ||
toggleKeyCode?: number; | ||
lngOverrideQS?: string; | ||
lngOverride?: string; | ||
mode?: "iframe" | "window"; | ||
iframeContainerStyle?: string; | ||
iframeStyle?: string; | ||
bodyStyle?: string; | ||
onEditorSaved?: (lng: null, ns: string | readonly string[]) => void; | ||
}; | ||
compatibilityJSON?: "v1" | "v2" | "v3" | "v4"; | ||
locizeLastUsed?: { | ||
@@ -88,2 +74,4 @@ projectId: string; | ||
maxParallelReads?: number; | ||
maxRetries?: number; | ||
retryTimeout?: number; | ||
backend?: object; | ||
@@ -90,0 +78,0 @@ detection?: object; |
{ | ||
"name": "@tolgee/i18next", | ||
"version": "4.10.0-rc.578d1d0.0", | ||
"version": "4.10.0-rc.66ab647.0", | ||
"description": "Tolgee i18n integration.", | ||
"main": "index.js", | ||
"main": "./dist/tolgee-i18next.cjs.js", | ||
"module": "./dist/tolgee-i18next.esm.js", | ||
@@ -45,3 +45,2 @@ "types": "./lib/index.d.ts", | ||
"@testing-library/jest-dom": "^5.11.4", | ||
"@types/intl-messageformat": "^3.0.0", | ||
"@types/jest": "^28.1.6", | ||
@@ -54,2 +53,3 @@ "@types/node": "^18.6.1", | ||
"rollup": "^2.78.1", | ||
"rollup-plugin-bundle-size": "^1.0.3", | ||
"rollup-plugin-sourcemaps": "^0.6.3", | ||
@@ -63,3 +63,3 @@ "rollup-plugin-terser": "7.0.2", | ||
}, | ||
"gitHead": "ada3bcfc1390b09eda73497b29a439ad5f42a405", | ||
"gitHead": "df9a876fc4dbbc6a38b54cff38f46f673e22f140", | ||
"peerDependencies": { | ||
@@ -73,3 +73,3 @@ "i18next": "^21.5.4" | ||
"dependencies": { | ||
"@tolgee/web": "^4.10.0-rc.578d1d0.0" | ||
"@tolgee/web": "4.10.0-rc.66ab647.0" | ||
}, | ||
@@ -76,0 +76,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
186178
33
926
+ Added@tolgee/core@4.10.0-rc.66ab647.0(transitive)
+ Added@tolgee/web@4.10.0-rc.66ab647.0(transitive)
- Removed@tolgee/web@4.10.0-rc.f068ae1.0(transitive)