Skip to content

Commit

Permalink
refactor: use registerKeyset (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov authored Aug 8, 2022
1 parent a93f5ed commit 57484a4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 36 deletions.
8 changes: 2 additions & 6 deletions src/components/Breadcrumbs/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../i18n';
import {Lang} from '../../utils/configure';
import {registerKeyset} from '../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'Breadcrumbs';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);
8 changes: 2 additions & 6 deletions src/components/ChangelogDialog/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../i18n';
import {Lang} from '../../utils/configure';
import {registerKeyset} from '../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'ChangelogDialog';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);
8 changes: 2 additions & 6 deletions src/components/ShareTooltip/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../i18n';
import {Lang} from '../../utils/configure';
import {registerKeyset} from '../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'yc-share-tooltip';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);
8 changes: 2 additions & 6 deletions src/components/Stories/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../i18n';
import {Lang} from '../../utils/configure';
import {registerKeyset} from '../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'Stories';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../../../../i18n';
import {Lang} from '../../../../../utils/configure';
import {registerKeyset} from '../../../../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'TableColumnSetup';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);
8 changes: 2 additions & 6 deletions src/components/Table/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import {i18n} from '../../../i18n';
import {Lang} from '../../utils/configure';
import {registerKeyset} from '../../utils/registerKeyset';
import en from './en.json';
import ru from './ru.json';

const COMPONENT = 'Table';

i18n.registerKeyset(Lang.En, COMPONENT, en);
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);

export default i18n.keyset(COMPONENT);
export default registerKeyset({en, ru}, COMPONENT);

0 comments on commit 57484a4

Please sign in to comment.