Skip to content

Commit 77a950b

Browse files
committed
chore: update @yandex-cloud/i18n to v0.6.0
1 parent ddc0868 commit 77a950b

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@testing-library/react": "11.2.7",
1414
"@testing-library/user-event": "12.8.3",
1515
"@types/qs": "6.9.7",
16-
"@yandex-cloud/i18n": "0.4.0",
16+
"@yandex-cloud/i18n": "0.6.0",
1717
"@yandex-cloud/paranoid": "1.0.0",
1818
"@yandex-cloud/react-data-table": "0.2.1",
1919
"axios": "0.19.2",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import {i18n, I18N} from '../../../../utils/i18n';
1+
import {i18n, Lang} from '../../../../utils/i18n';
22

33
import en from './en.json';
44
import ru from './ru.json';
55

66
const COMPONENT = 'nv-settings';
77

8-
i18n.registerKeyset(I18N.LANGS.en, COMPONENT, en);
9-
i18n.registerKeyset(I18N.LANGS.ru, COMPONENT, ru);
8+
i18n.registerKeyset(Lang.En, COMPONENT, en);
9+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
1010

1111
export default i18n.keyset(COMPONENT);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import {i18n, I18N} from '../../../utils/i18n';
1+
import {i18n, Lang} from '../../../utils/i18n';
22

33
import en from './en.json';
44
import ru from './ru.json';
55

66
const COMPONENT = 'ydb-embedded-ui';
77

8-
i18n.registerKeyset(I18N.LANGS.en, COMPONENT, en);
9-
i18n.registerKeyset(I18N.LANGS.ru, COMPONENT, ru);
8+
i18n.registerKeyset(Lang.En, COMPONENT, en);
9+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
1010

1111
export default i18n.keyset(COMPONENT);

src/containers/App/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
33
import PropTypes from 'prop-types';
44

55
import {i18n as YDBComponentsI18N} from 'ydb-ui-components';
6-
import {I18N, i18n} from '../../utils/i18n';
6+
import {i18n, Lang} from '../../utils/i18n';
77

88
import ContentWrapper, {Content} from './Content';
99
import AsideNavigation from '../AsideNavigation/AsideNavigation';
@@ -25,8 +25,8 @@ class App extends React.Component {
2525

2626
constructor(props) {
2727
super(props);
28-
i18n.setLang(I18N.LANGS.en);
29-
YDBComponentsI18N.setLang(I18N.LANGS.en);
28+
i18n.setLang(Lang.En);
29+
YDBComponentsI18N.setLang(Lang.En);
3030
}
3131

3232
componentDidMount() {

src/utils/i18n/i18n.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {I18N} from '@yandex-cloud/i18n';
22

3-
export type Lang = keyof typeof I18N.LANGS;
3+
export enum Lang {
4+
En = 'en',
5+
Ru = 'ru',
6+
}
47

58
export const i18n = new I18N();
6-
7-
export {I18N} from '@yandex-cloud/i18n';

0 commit comments

Comments
 (0)