Skip to content

Commit

Permalink
types: backend options release
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Dec 10, 2022
1 parent cb2db46 commit 6cdf92c
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 22.2.0

- types: extend the init method with a generic parameter for backend options [1878](https://github.com/i18next/i18next/pull/1878), [105](https://github.com/i18next/i18next-http-backend/pull/105), [34](https://github.com/i18next/i18next-fs-backend/pull/34)

## 22.1.5

- types: ability to pass ns as option instead of prefix i.e. `i18next.t('bar', { ns: 'alternate' });`
Expand Down
27 changes: 20 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -75,7 +75,8 @@
"gh-release": "6.0.4",
"husky": "^7.0.2",
"i18next-browser-languagedetector": "7.0.1",
"i18next-http-backend": "^2.0.2",
"i18next-fs-backend": "2.1.0",
"i18next-http-backend": "2.1.0",
"i18next-localstorage-cache": "1.1.1",
"i18next-sprintf-postprocessor": "0.2.2",
"karma": "6.4.1",
Expand Down
23 changes: 23 additions & 0 deletions test/typescript/backend.test.ts
@@ -0,0 +1,23 @@
import i18next from 'i18next';

import HttpBackend, { HttpBackendOptions } from 'i18next-http-backend';
import FsBackend, { FsBackendOptions } from 'i18next-fs-backend';

i18next.use(HttpBackend).init<HttpBackendOptions>({
lng: 'en',
// ...
backend: {
loadPath: 'some/path',
customHeaders: {
some: 'header',
},
},
});

i18next.use(FsBackend).init<FsBackendOptions>({
lng: 'en',
// ...
backend: {
loadPath: 'some/path',
},
});

0 comments on commit 6cdf92c

Please sign in to comment.