-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
51 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
import React from 'react'; | ||
import block from 'bem-cn-lite'; | ||
import {dict} from '../../dict/dict'; | ||
import {settings} from '../../libs'; | ||
import {i18n} from '../../i18n'; | ||
|
||
import './ErrorView.scss'; | ||
|
||
const b = block('chartkit-error'); | ||
|
||
export const ErrorView = () => { | ||
const lang = settings.get('lang'); | ||
|
||
return ( | ||
<div className={b()}> | ||
<div className={b('title')}>{dict(lang, 'error')}</div> | ||
<div className={b('message')}>{dict(lang, 'error-unknown-extension')}</div> | ||
<div className={b('title')}>{i18n('common', 'error')}</div> | ||
<div className={b('message')}>{i18n('common', 'error-unknown-extension')}</div> | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {I18N, I18NFn} from '@yandex-cloud/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}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"common": { | ||
"error": "Error", | ||
"error-unknown-extension": "Unknown chart type", | ||
"tooltip-sum": "Sum", | ||
"tooltip-rest": "Rest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"common": { | ||
"error": "Ошибка", | ||
"error-unknown-extension": "Неизвестный тип чарта", | ||
"tooltip-sum": "Сумма", | ||
"tooltip-rest": "Остальные" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters