All files / src/i18n index.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21                    5x 5x 5x   5x 5x   5x      
import {I18N, I18NFn} from '@gravity-ui/i18n';
 
import type {ChartKitLang} from '../types';
 
import en from './keysets/en.json';
import ru from './keysets/ru.json';
 
type Keysets = typeof en;
type TypedI18n = I18NFn<Keysets>;
 
const i18nFactory = new I18N();
const EN: ChartKitLang = 'en';
const RU: ChartKitLang = 'ru';
 
i18nFactory.registerKeysets(EN, en);
i18nFactory.registerKeysets(RU, ru);
 
const i18n = i18nFactory.i18n.bind(i18nFactory) as TypedI18n;
 
export {i18nFactory, i18n};