@cloud-ru/uikit-product-locale 2.7.1-preview-e1ec0822.0 → 2.7.1
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 +11 -0
- package/dist/cjs/components/Locale.js +2 -2
- package/dist/cjs/helpers/getTranslationResolver.js +4 -4
- package/dist/esm/components/Locale.js +1 -1
- package/dist/esm/helpers/getTranslationResolver.js +2 -2
- package/package.json +5 -9
- package/src/components/Locale.tsx +1 -1
- package/src/helpers/getTranslationResolver.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.7.1 (2026-04-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **FF-8426:** replace legacy lodash packages with new one ([52aa612](https://github.com/cloud-ru-tech/uikit-product/commit/52aa61216297a22e6c1b33c19586e35d73adda51))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 2.7.0 (2026-04-14)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.LocaleProvider = LocaleProvider;
|
|
7
7
|
exports.useLocale = useLocale;
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
-
const
|
|
9
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const locale_1 = require("@snack-uikit/locale");
|
|
12
12
|
const locales_1 = require("../locales");
|
|
13
13
|
const resolveCommonTranslations_1 = require("../locales/resolveCommonTranslations");
|
|
14
14
|
function LocaleProvider({ children, overrideLocales, lang, fallbackLang = 'ru-RU', additionalTranslationsResources, }) {
|
|
15
|
-
const memoizedLocales = (0, react_1.useMemo)(() => (0,
|
|
15
|
+
const memoizedLocales = (0, react_1.useMemo)(() => (0, merge_1.default)({}, locales_1.UIKIT_PRODUCT_LOCALES,
|
|
16
16
|
/* Тип обязывает прокинуть доп. переводы, но если это не сделать, ничего не упадет */
|
|
17
17
|
additionalTranslationsResources ? (0, resolveCommonTranslations_1.resolveCommonTranslations)(additionalTranslationsResources) : {}, overrideLocales), [overrideLocales, additionalTranslationsResources]);
|
|
18
18
|
return ((0, jsx_runtime_1.jsx)(locale_1.LocaleProvider, { lang: lang, overrideLocales: memoizedLocales, fallbackLang: fallbackLang, children: children }));
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getTranslationResolver = void 0;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
8
|
+
const set_1 = __importDefault(require("lodash/set"));
|
|
9
9
|
function crawler({ data, prefix = '', handler }) {
|
|
10
10
|
if (typeof data === 'string') {
|
|
11
11
|
handler(prefix, data);
|
|
@@ -24,9 +24,9 @@ const getTranslationResolver = (data, nameSpace) => (additionalTranslations) =>
|
|
|
24
24
|
crawler({
|
|
25
25
|
data,
|
|
26
26
|
handler: (path, value) => {
|
|
27
|
-
const text = (0,
|
|
27
|
+
const text = (0, get_1.default)(additionalTranslations, `${lang}.${nameSpace}.${value}`);
|
|
28
28
|
if (text !== undefined) {
|
|
29
|
-
(0,
|
|
29
|
+
(0, set_1.default)(result, `${lang}.${path}`, text);
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import merge from 'lodash
|
|
2
|
+
import merge from 'lodash/merge';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { LocaleProvider as SnackLocaleProvider, useLocale as snackUseLocale, } from '@snack-uikit/locale';
|
|
5
5
|
import { UIKIT_PRODUCT_LOCALES } from '../locales';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-locale",
|
|
3
3
|
"title": "Locale",
|
|
4
|
-
"version": "2.7.1
|
|
4
|
+
"version": "2.7.1",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -37,15 +37,11 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@cloud-ru/common-translations": "1.3.2",
|
|
40
|
-
"@snack-uikit/locale": "0.15.
|
|
41
|
-
"lodash
|
|
42
|
-
"lodash.merge": "4.6.2",
|
|
43
|
-
"lodash.set": "4.3.2"
|
|
40
|
+
"@snack-uikit/locale": "0.15.5",
|
|
41
|
+
"lodash": "4.18.1"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@types/lodash
|
|
47
|
-
"@types/lodash.merge": "4.6.9",
|
|
48
|
-
"@types/lodash.set": "4.3.9"
|
|
44
|
+
"@types/lodash": "4.17.24"
|
|
49
45
|
},
|
|
50
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "e0d81a7ce18d3b53042bda22c5d76bc68957fd31"
|
|
51
47
|
}
|