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 CHANGED
@@ -1,3 +1,7 @@
1
+ ### 11.16.10
2
+
3
+ - types: translation component types [1509](https://github.com/i18next/react-i18next/pull/1509)
4
+
1
5
  ### 11.16.9
2
6
 
3
7
  - types: fix missing generic type for HTMLAttributes [1499](https://github.com/i18next/react-i18next/pull/1499)
package/README.md CHANGED
@@ -3,12 +3,14 @@
3
3
  [![CircleCI](https://circleci.com/gh/i18next/react-i18next.svg?style=svg)](https://circleci.com/gh/i18next/react-i18next)
4
4
  [![Code Climate](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/i18next/react-i18next)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/i18next/react-i18next/badge.svg)](https://coveralls.io/github/i18next/react-i18next)
6
- [![Quality][quality-badge] ][quality-url]
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]: http://npm.packagequality.com/shield/react-i18next.svg
11
- [quality-url]: http://packagequality.com/#?package=react-i18next
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-i18next",
3
- "version": "11.16.9",
3
+ "version": "11.16.10",
4
4
  "description": "Internationalization for react done right. Using the i18next i18n ecosystem.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "types": "./index.d.ts",
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<N extends Namespace = DefaultNamespace> {
330
- t: TFunction<N>;
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<N extends Namespace = DefaultNamespace>(
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<N extends Namespace = DefaultNamespace>(
379
- props: TranslationProps<N>,
380
- ): any;
386
+ export function Translation<
387
+ N extends Namespace = DefaultNamespace,
388
+ TKPrefix extends KeyPrefix<N> = undefined
389
+ >(props: TranslationProps<N, TKPrefix>): any;