react-i18next 11.16.9 → 11.16.10
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/CHANGELOG.md +4 -0
- package/README.md +5 -3
- package/package.json +1 -1
- package/ts4.1/index.d.ts +17 -8
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
[](https://circleci.com/gh/i18next/react-i18next)
|
|
4
4
|
[](https://codeclimate.com/github/i18next/react-i18next)
|
|
5
5
|
[](https://coveralls.io/github/i18next/react-i18next)
|
|
6
|
-
[![Quality][quality-badge]
|
|
6
|
+
[![Quality][quality-badge]][quality-url]
|
|
7
|
+
[![npm][npm-dl-badge]][npm-url]
|
|
7
8
|
|
|
8
9
|
[npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true
|
|
9
10
|
[npm-url]: https://npmjs.org/package/react-i18next
|
|
10
|
-
[quality-badge]:
|
|
11
|
-
[quality-url]:
|
|
11
|
+
[quality-badge]: https://npm.packagequality.com/shield/react-i18next.svg
|
|
12
|
+
[quality-url]: https://packagequality.com/#?package=react-i18next
|
|
13
|
+
[npm-dl-badge]: https://img.shields.io/npm/dw/react-i18next
|
|
12
14
|
|
|
13
15
|
### IMPORTANT:
|
|
14
16
|
|
package/package.json
CHANGED
package/ts4.1/index.d.ts
CHANGED
|
@@ -326,8 +326,11 @@ export function withSSR(): <Props>(
|
|
|
326
326
|
getInitialProps: (ctx: unknown) => Promise<any>;
|
|
327
327
|
};
|
|
328
328
|
|
|
329
|
-
export interface WithTranslation<
|
|
330
|
-
|
|
329
|
+
export interface WithTranslation<
|
|
330
|
+
N extends Namespace = DefaultNamespace,
|
|
331
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
332
|
+
> {
|
|
333
|
+
t: TFunction<N, TKPrefix>;
|
|
331
334
|
i18n: i18n;
|
|
332
335
|
tReady: boolean;
|
|
333
336
|
}
|
|
@@ -337,10 +340,14 @@ export interface WithTranslationProps {
|
|
|
337
340
|
useSuspense?: boolean;
|
|
338
341
|
}
|
|
339
342
|
|
|
340
|
-
export function withTranslation<
|
|
343
|
+
export function withTranslation<
|
|
344
|
+
N extends Namespace = DefaultNamespace,
|
|
345
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
346
|
+
>(
|
|
341
347
|
ns?: N,
|
|
342
348
|
options?: {
|
|
343
349
|
withRef?: boolean;
|
|
350
|
+
keyPrefix?: TKPrefix;
|
|
344
351
|
},
|
|
345
352
|
): <
|
|
346
353
|
C extends React.ComponentType<React.ComponentProps<any> & WithTranslationProps>,
|
|
@@ -361,9 +368,9 @@ export interface I18nextProviderProps {
|
|
|
361
368
|
export const I18nextProvider: React.FunctionComponent<I18nextProviderProps>;
|
|
362
369
|
export const I18nContext: React.Context<{ i18n: i18n }>;
|
|
363
370
|
|
|
364
|
-
export interface TranslationProps<N extends Namespace = DefaultNamespace> {
|
|
371
|
+
export interface TranslationProps<N extends Namespace = DefaultNamespace, TKPrefix> {
|
|
365
372
|
children: (
|
|
366
|
-
t: TFunction<N>,
|
|
373
|
+
t: TFunction<N, TKPrefix>,
|
|
367
374
|
options: {
|
|
368
375
|
i18n: i18n;
|
|
369
376
|
lng: string;
|
|
@@ -373,8 +380,10 @@ export interface TranslationProps<N extends Namespace = DefaultNamespace> {
|
|
|
373
380
|
ns?: N;
|
|
374
381
|
i18n?: i18n;
|
|
375
382
|
useSuspense?: boolean;
|
|
383
|
+
keyPrefix?: TKPrefix;
|
|
376
384
|
}
|
|
377
385
|
|
|
378
|
-
export function Translation<
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
export function Translation<
|
|
387
|
+
N extends Namespace = DefaultNamespace,
|
|
388
|
+
TKPrefix extends KeyPrefix<N> = undefined
|
|
389
|
+
>(props: TranslationProps<N, TKPrefix>): any;
|