react-i18next 16.1.1 → 16.1.2
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/dist/commonjs/IcuTransUtils/index.js +4 -4
- package/dist/commonjs/IcuTransUtils/renderTranslation.js +3 -3
- package/dist/commonjs/IcuTransWithoutContext.js +2 -2
- package/dist/es/IcuTransUtils/index.js +4 -4
- package/dist/es/IcuTransUtils/renderTranslation.js +3 -3
- package/dist/es/IcuTransWithoutContext.js +1 -1
- package/dist/es/package.json +1 -1
- package/package.json +1 -1
- package/src/IcuTransUtils/index.js +4 -4
- package/src/IcuTransUtils/renderTranslation.js +3 -3
- package/src/IcuTransWithoutContext.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _TranslationParserError = require("./TranslationParserError");
|
|
6
|
+
var _TranslationParserError = require("./TranslationParserError.js");
|
|
7
7
|
Object.keys(_TranslationParserError).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
9
|
if (key in exports && exports[key] === _TranslationParserError[key]) return;
|
|
@@ -14,7 +14,7 @@ Object.keys(_TranslationParserError).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _htmlEntityDecoder = require("./htmlEntityDecoder");
|
|
17
|
+
var _htmlEntityDecoder = require("./htmlEntityDecoder.js");
|
|
18
18
|
Object.keys(_htmlEntityDecoder).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
20
|
if (key in exports && exports[key] === _htmlEntityDecoder[key]) return;
|
|
@@ -25,7 +25,7 @@ Object.keys(_htmlEntityDecoder).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var _tokenizer = require("./tokenizer");
|
|
28
|
+
var _tokenizer = require("./tokenizer.js");
|
|
29
29
|
Object.keys(_tokenizer).forEach(function (key) {
|
|
30
30
|
if (key === "default" || key === "__esModule") return;
|
|
31
31
|
if (key in exports && exports[key] === _tokenizer[key]) return;
|
|
@@ -36,7 +36,7 @@ Object.keys(_tokenizer).forEach(function (key) {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var _renderTranslation = require("./renderTranslation");
|
|
39
|
+
var _renderTranslation = require("./renderTranslation.js");
|
|
40
40
|
Object.keys(_renderTranslation).forEach(function (key) {
|
|
41
41
|
if (key === "default" || key === "__esModule") return;
|
|
42
42
|
if (key in exports && exports[key] === _renderTranslation[key]) return;
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.renderTranslation = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _TranslationParserError = require("./TranslationParserError");
|
|
10
|
-
var _tokenizer = require("./tokenizer");
|
|
11
|
-
var _htmlEntityDecoder = require("./htmlEntityDecoder");
|
|
9
|
+
var _TranslationParserError = require("./TranslationParserError.js");
|
|
10
|
+
var _tokenizer = require("./tokenizer.js");
|
|
11
|
+
var _htmlEntityDecoder = require("./htmlEntityDecoder.js");
|
|
12
12
|
const renderDeclarationNode = (declaration, children, childDeclarations) => {
|
|
13
13
|
const {
|
|
14
14
|
type,
|
|
@@ -8,7 +8,7 @@ exports.IcuTransWithoutContext = IcuTransWithoutContext;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _utils = require("./utils.js");
|
|
10
10
|
var _i18nInstance = require("./i18nInstance.js");
|
|
11
|
-
var
|
|
11
|
+
var _index = require("./IcuTransUtils/index.js");
|
|
12
12
|
function IcuTransWithoutContext({
|
|
13
13
|
i18nKey,
|
|
14
14
|
defaultTranslation,
|
|
@@ -43,7 +43,7 @@ function IcuTransWithoutContext({
|
|
|
43
43
|
ns: namespaces
|
|
44
44
|
});
|
|
45
45
|
try {
|
|
46
|
-
const rendered = (0,
|
|
46
|
+
const rendered = (0, _index.renderTranslation)(translation, content);
|
|
47
47
|
return _react.default.createElement(_react.default.Fragment, {}, ...rendered);
|
|
48
48
|
} catch (error) {
|
|
49
49
|
(0, _utils.warn)(i18n, 'ICU_TRANS_RENDER_ERROR', `IcuTrans component error for key "${i18nKey}": ${error.message}`, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './TranslationParserError';
|
|
2
|
-
export * from './htmlEntityDecoder';
|
|
3
|
-
export * from './tokenizer';
|
|
4
|
-
export * from './renderTranslation';
|
|
1
|
+
export * from './TranslationParserError.js';
|
|
2
|
+
export * from './htmlEntityDecoder.js';
|
|
3
|
+
export * from './tokenizer.js';
|
|
4
|
+
export * from './renderTranslation.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TranslationParserError } from './TranslationParserError';
|
|
3
|
-
import { tokenize } from './tokenizer';
|
|
4
|
-
import { decodeHtmlEntities } from './htmlEntityDecoder';
|
|
2
|
+
import { TranslationParserError } from './TranslationParserError.js';
|
|
3
|
+
import { tokenize } from './tokenizer.js';
|
|
4
|
+
import { decodeHtmlEntities } from './htmlEntityDecoder.js';
|
|
5
5
|
const renderDeclarationNode = (declaration, children, childDeclarations) => {
|
|
6
6
|
const {
|
|
7
7
|
type,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { warn, warnOnce, isString } from './utils.js';
|
|
3
3
|
import { getI18n } from './i18nInstance.js';
|
|
4
|
-
import { renderTranslation } from './IcuTransUtils';
|
|
4
|
+
import { renderTranslation } from './IcuTransUtils/index.js';
|
|
5
5
|
export function IcuTransWithoutContext({
|
|
6
6
|
i18nKey,
|
|
7
7
|
defaultTranslation,
|
package/dist/es/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"16.1.
|
|
1
|
+
{"type":"module","version":"16.1.2"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './TranslationParserError';
|
|
2
|
-
export * from './htmlEntityDecoder';
|
|
3
|
-
export * from './tokenizer';
|
|
4
|
-
export * from './renderTranslation';
|
|
1
|
+
export * from './TranslationParserError.js';
|
|
2
|
+
export * from './htmlEntityDecoder.js';
|
|
3
|
+
export * from './tokenizer.js';
|
|
4
|
+
export * from './renderTranslation.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { TranslationParserError } from './TranslationParserError';
|
|
4
|
-
import { tokenize } from './tokenizer';
|
|
5
|
-
import { decodeHtmlEntities } from './htmlEntityDecoder';
|
|
3
|
+
import { TranslationParserError } from './TranslationParserError.js';
|
|
4
|
+
import { tokenize } from './tokenizer.js';
|
|
5
|
+
import { decodeHtmlEntities } from './htmlEntityDecoder.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Render a React element tree from a declaration node and its children
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { warn, warnOnce, isString } from './utils.js';
|
|
3
3
|
import { getI18n } from './i18nInstance.js';
|
|
4
|
-
import { renderTranslation } from './IcuTransUtils';
|
|
4
|
+
import { renderTranslation } from './IcuTransUtils/index.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* IcuTrans component for rendering ICU MessageFormat translations (without React Context)
|