diff --git a/README.md b/README.md index fdc2098..90d69fd 100644 --- a/README.md +++ b/README.md @@ -93,8 +93,19 @@ for plain browser: // the function might return a promise // returning falsy will abort the download // - // If allowMultiLoading is false, lngs and namespaces will have only one element each, - // If allowMultiLoading is true, lngs and namespaces can have multiple elements + // If not used with i18next-multiload-backend-adapter, lngs and namespaces will have only one element each, + // If used with i18next-multiload-backend-adapter, lngs and namespaces can have multiple elements + // and also your server needs to support multiloading + // /locales/resources.json?lng=de+en&ns=ns1+ns2 + // Adapter is needed to enable MultiLoading https://github.com/i18next/i18next-multiload-backend-adapter + // Returned JSON structure in this case is + // { + // lang : { + // namespaceA: {}, + // namespaceB: {}, + // ...etc + // } + // } loadPath: '/locales/{{lng}}/{{ns}}.json', // path to post missing resources, or a function @@ -102,19 +113,6 @@ for plain browser: // the returned path will interpolate lng, ns if provided like giving a static path addPath: '/locales/add/{{lng}}/{{ns}}', - // your backend server supports multiloading - // /locales/resources.json?lng=de+en&ns=ns1+ns2 - // Adapter is needed to enable MultiLoading https://github.com/i18next/i18next-multiload-backend-adapter - // Returned JSON structure in this case is - // { - // lang : { - // namespaceA: {}, - // namespaceB: {}, - // ...etc - // } - // } - allowMultiLoading: false, // set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading - // parse data after it has been fetched // in example use https://www.npmjs.com/package/json5 // here it removes the letter a from the json (bad idea) diff --git a/index.d.ts b/index.d.ts index a43db17..0dd9cf5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -22,12 +22,6 @@ export interface HttpBackendOptions { * function(lng, namespace) { return customPath; } */ addPath?: AddPathOption; - /** - * your backend server supports multiLoading - * locales/resources.json?lng=de+en&ns=ns1+ns2 - * set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading - */ - allowMultiLoading?: boolean; /** * parse data after it has been fetched * in example use https://www.npmjs.com/package/json5 diff --git a/lib/index.js b/lib/index.js index 2c80171..69b37bb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,7 +5,6 @@ const getDefaults = () => { return { loadPath: '/locales/{{lng}}/{{ns}}.json', addPath: '/locales/add/{{lng}}/{{ns}}', - allowMultiLoading: false, parse: data => JSON.parse(data), stringify: JSON.stringify, parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || '' }),