react-i18next 11.15.0 → 11.15.4
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 +16 -0
- package/README.md +3 -8
- package/index.d.ts +1 -0
- package/package.json +12 -4
- package/ts4.1/icu.macro.d.ts +1 -0
- package/ts4.1/index.d.ts +9 -8
- package/tslint.json +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
### 11.15.4
|
|
2
|
+
|
|
3
|
+
- types: add values field to Plural component in macros [1446](https://github.com/i18next/react-i18next/pull/1446)
|
|
4
|
+
|
|
5
|
+
### 11.15.3
|
|
6
|
+
|
|
7
|
+
- types: fix for issue introduced with type extension for react-native [1436](https://github.com/i18next/react-i18next/pull/1436)
|
|
8
|
+
|
|
9
|
+
### 11.15.2
|
|
10
|
+
|
|
11
|
+
- types: TypeScript interface for the Trans component does now accept react-native props [1418](https://github.com/i18next/react-i18next/pull/1418)
|
|
12
|
+
|
|
13
|
+
### 11.15.1
|
|
14
|
+
|
|
15
|
+
- add missing types for shouldUnescape and useTranslation [1429](https://github.com/i18next/react-i18next/pull/1429)
|
|
16
|
+
|
|
1
17
|
### 11.15.0
|
|
2
18
|
|
|
3
19
|
- option to unescape html in Trans [1426](https://github.com/i18next/react-i18next/pull/1426)
|
package/README.md
CHANGED
|
@@ -4,15 +4,9 @@
|
|
|
4
4
|
[](https://codeclimate.com/github/i18next/react-i18next)
|
|
5
5
|
[](https://coveralls.io/github/i18next/react-i18next)
|
|
6
6
|
[![Quality][quality-badge] ][quality-url]
|
|
7
|
-
[![dependencies][dependencies-image] ][dependencies-url]
|
|
8
|
-
[![devdependencies][devdependencies-image] ][devdependencies-url]
|
|
9
7
|
|
|
10
8
|
[npm-icon]: https://nodei.co/npm/react-i18next.png?downloads=true
|
|
11
9
|
[npm-url]: https://npmjs.org/package/react-i18next
|
|
12
|
-
[dependencies-image]: https://david-dm.org/i18next/react-i18next.png
|
|
13
|
-
[dependencies-url]: https://david-dm.org/i18next/react-i18next
|
|
14
|
-
[devdependencies-image]: https://david-dm.org/i18next/react-i18next/dev-status.png
|
|
15
|
-
[devdependencies-url]: https://david-dm.org/i18next/react-i18next#info=devDependencies
|
|
16
10
|
[quality-badge]: http://npm.packagequality.com/shield/react-i18next.svg
|
|
17
11
|
[quality-url]: http://packagequality.com/#?package=react-i18next
|
|
18
12
|
|
|
@@ -36,8 +30,9 @@ npm i react-i18next@legacy
|
|
|
36
30
|
|
|
37
31
|
### Documentation
|
|
38
32
|
|
|
39
|
-
The documentation is published on [react.i18next.com](https://react.i18next.com)
|
|
40
|
-
|
|
33
|
+
The documentation is published on [react.i18next.com](https://react.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/react-i18next-gitbook).
|
|
34
|
+
|
|
35
|
+
The general i18next documentation is published on [www.i18next.com](https://www.i18next.com) and PR changes can be supplied [here](https://github.com/i18next/i18next-gitbook).
|
|
41
36
|
|
|
42
37
|
### What will my code look like?
|
|
43
38
|
|
package/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export interface TransProps<E extends Element = HTMLDivElement>
|
|
|
43
43
|
parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
|
|
44
44
|
tOptions?: {};
|
|
45
45
|
values?: {};
|
|
46
|
+
shouldUnescape?: boolean;
|
|
46
47
|
t?: TFunction;
|
|
47
48
|
}
|
|
48
49
|
export function Trans<E extends Element = HTMLDivElement>(props: TransProps<E>): React.ReactElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-i18next",
|
|
3
|
-
"version": "11.15.
|
|
3
|
+
"version": "11.15.4",
|
|
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",
|
|
@@ -93,6 +93,14 @@
|
|
|
93
93
|
"i18next": ">= 19.0.0",
|
|
94
94
|
"react": ">= 16.8.0"
|
|
95
95
|
},
|
|
96
|
+
"peerDependenciesMeta": {
|
|
97
|
+
"react-dom": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"react-native": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
96
104
|
"scripts": {
|
|
97
105
|
"clean": "rimraf dist && mkdirp dist",
|
|
98
106
|
"copy": "cp-cli ./dist/umd/react-i18next.min.js ./react-i18next.min.js && cp-cli ./dist/umd/react-i18next.js ./react-i18next.js",
|
|
@@ -109,9 +117,9 @@
|
|
|
109
117
|
"test:watch": "cross-env BABEL_ENV=development jest --no-cache --watch",
|
|
110
118
|
"test:coverage": "cross-env BABEL_ENV=development jest --no-cache --coverage",
|
|
111
119
|
"test:lint": "eslint ./src ./test",
|
|
112
|
-
"test:typescript": "tslint --project tsconfig.json",
|
|
113
|
-
"test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json",
|
|
114
|
-
"test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json",
|
|
120
|
+
"test:typescript": "tslint --project tsconfig.json '**/*.ts'",
|
|
121
|
+
"test:typescript:noninterop": "tslint --project tsconfig.nonEsModuleInterop.json '**/*.ts'",
|
|
122
|
+
"test:typescript:customtypes": "tslint --project ./test/typescript/custom-types/tsconfig.json '**/*.ts'",
|
|
115
123
|
"contributors:add": "all-contributors add",
|
|
116
124
|
"contributors:generate": "all-contributors generate",
|
|
117
125
|
"prettier": "prettier --write \"{,**/}*.{ts,tsx,js,json,md}\""
|
package/ts4.1/icu.macro.d.ts
CHANGED
package/ts4.1/index.d.ts
CHANGED
|
@@ -130,10 +130,10 @@ type NormalizeMulti<T, U extends keyof T, L = LastOf<U>> = L extends U
|
|
|
130
130
|
? AppendNS<L, Normalize<T[L]>> | NormalizeMulti<T, Exclude<U, L>>
|
|
131
131
|
: never;
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
interface CustomTypeParameters {
|
|
134
134
|
returnNull?: boolean;
|
|
135
135
|
returnEmptyString?: boolean;
|
|
136
|
-
}
|
|
136
|
+
}
|
|
137
137
|
|
|
138
138
|
type TypeOptionsFallback<TranslationValue, Option, MatchingValue> = Option extends false
|
|
139
139
|
? TranslationValue extends MatchingValue
|
|
@@ -234,12 +234,12 @@ export interface TFunction<N extends Namespace = DefaultNamespace, TKPrefix = un
|
|
|
234
234
|
): TFuncReturn<N, TKeys, TDefaultResult, TKPrefix>;
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
export
|
|
237
|
+
export type TransProps<
|
|
238
238
|
K extends TFuncKey<N, TKPrefix> extends infer A ? A : never,
|
|
239
239
|
N extends Namespace = DefaultNamespace,
|
|
240
240
|
TKPrefix = undefined,
|
|
241
|
-
E
|
|
242
|
-
>
|
|
241
|
+
E = React.HTMLProps<HTMLDivElement>
|
|
242
|
+
> = E & {
|
|
243
243
|
children?: React.ReactNode;
|
|
244
244
|
components?: readonly React.ReactNode[] | { readonly [tagName: string]: React.ReactNode };
|
|
245
245
|
count?: number;
|
|
@@ -250,14 +250,15 @@ export interface TransProps<
|
|
|
250
250
|
parent?: string | React.ComponentType<any> | null; // used in React.createElement if not null
|
|
251
251
|
tOptions?: {};
|
|
252
252
|
values?: {};
|
|
253
|
+
shouldUnescape?: boolean;
|
|
253
254
|
t?: TFunction<N, TKPrefix>;
|
|
254
|
-
}
|
|
255
|
+
};
|
|
255
256
|
|
|
256
257
|
export function Trans<
|
|
257
258
|
K extends TFuncKey<N, TKPrefix> extends infer A ? A : never,
|
|
258
259
|
N extends Namespace = DefaultNamespace,
|
|
259
260
|
TKPrefix extends KeyPrefix<N> = undefined,
|
|
260
|
-
E
|
|
261
|
+
E = React.HTMLProps<HTMLDivElement>
|
|
261
262
|
>(props: TransProps<K, N, TKPrefix, E>): React.ReactElement;
|
|
262
263
|
|
|
263
264
|
export function useSSR(initialI18nStore: Resource, initialLanguage: string): void;
|
|
@@ -268,7 +269,7 @@ export interface UseTranslationOptions<TKPrefix = undefined> {
|
|
|
268
269
|
keyPrefix?: TKPrefix;
|
|
269
270
|
}
|
|
270
271
|
|
|
271
|
-
type UseTranslationResponse<N extends Namespace, TKPrefix> = [
|
|
272
|
+
export type UseTranslationResponse<N extends Namespace, TKPrefix = undefined> = [
|
|
272
273
|
TFunction<N, TKPrefix>,
|
|
273
274
|
i18n,
|
|
274
275
|
boolean,
|
package/tslint.json
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
"defaultSeverity": "error",
|
|
3
3
|
"extends": "dtslint/dtslint.json",
|
|
4
4
|
"rules": {
|
|
5
|
-
"
|
|
5
|
+
"array-type": [true, "array"],
|
|
6
|
+
"no-empty-interface": false,
|
|
7
|
+
"no-redundant-jsdoc": false,
|
|
8
|
+
"no-unnecessary-generics": false,
|
|
9
|
+
"semicolon": false,
|
|
10
|
+
"strict-export-declare-modifiers": false
|
|
11
|
+
},
|
|
12
|
+
"linterOptions": {
|
|
13
|
+
"exclude": ["node_modules/**/*"]
|
|
6
14
|
}
|
|
7
15
|
}
|