Skip to content

Commit 237c2cd

Browse files
committed
chore: update @yandex-cloud/i18n to v0.6.0
1 parent 0745e6c commit 237c2cd

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

.storybook/decorators/withLang.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react';
22
import {Story as StoryType, StoryContext} from '@storybook/react';
3-
import {I18N} from '@yandex-cloud/i18n';
3+
4+
import {i18n} from '../../src/components/i18n';
45

56
export function withLang(Story: StoryType, context: StoryContext) {
67
const lang = context.globals.lang;
78

8-
I18N.setDefaultLang(lang);
9+
i18n.setLang(lang);
910

1011
return <Story key={lang} {...context} />;
1112
}

.storybook/preview.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import '@yandex-cloud/uikit/styles/styles.scss';
22

33
import React from 'react';
4-
import {I18N} from '@yandex-cloud/i18n';
54
import {ThemeProvider} from '@yandex-cloud/uikit';
5+
6+
import {i18n} from '../src/components/i18n';
7+
68
import {withTheme} from './decorators/withTheme';
79
import {withLang} from './decorators/withLang';
810

9-
I18N.setDefaultLang(I18N.LANGS.ru);
11+
i18n.setLang('ru');
1012

1113
const withContextProvider = (Story, context) => {
1214
const theme = context.globals.theme;

package-lock.json

Lines changed: 6 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@types/react-treeview": "^0.4.3",
4040
"@yandex-cloud/browserslist-config": "^1.0.1",
4141
"@yandex-cloud/eslint-config": "^1.0.0",
42-
"@yandex-cloud/i18n": "^0.4.0",
42+
"@yandex-cloud/i18n": "^0.6.0",
4343
"@yandex-cloud/prettier-config": "^1.0.0",
4444
"@yandex-cloud/stylelint-config": "^1.1.0",
4545
"@yandex-cloud/tsconfig": "^1.0.0",
@@ -66,7 +66,7 @@
6666
},
6767
"peerDependencies": {
6868
"@yandex-cloud/browserslist-config": "^1.0.1",
69-
"@yandex-cloud/i18n": "^0.4.0",
69+
"@yandex-cloud/i18n": "^0.6.0",
7070
"@yandex-cloud/uikit": "^1.8.0",
7171
"react": "^16.0.0",
7272
"react-dom": "^16.0.0"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {i18n, I18N} from '../../i18n';
1+
import {i18n} from '../../i18n';
22
import en from './en.json';
33
import ru from './ru.json';
44

55
const COMPONENT = 'ydb-navigation-tree';
66

7-
i18n.registerKeyset(I18N.LANGS.en, COMPONENT, en);
8-
i18n.registerKeyset(I18N.LANGS.ru, COMPONENT, ru);
7+
i18n.registerKeyset('en', COMPONENT, en);
8+
i18n.registerKeyset('ru', COMPONENT, ru);
99

1010
export default i18n.keyset(COMPONENT);

0 commit comments

Comments
 (0)