Skip to content

Commit 75f9851

Browse files
committed
fix(Healthcheck): add translations
1 parent 3f34b7a commit 75f9851

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

src/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {getHealthcheckInfo} from '../../../../store/reducers/healthcheckInfo';
1111
import {hideTooltip, showTooltip} from '../../../../store/reducers/tooltip';
1212
import {AutoFetcher} from '../../../../utils/autofetcher';
1313

14+
import i18n from './i18n';
1415
import './Healthcheck.scss';
1516

1617
const b = cn('healthcheck');
@@ -73,7 +74,7 @@ class Healthcheck extends React.Component {
7374
const {loading} = this.props;
7475
return (
7576
<Button size="s" onClick={this.fetchHealthcheck} loading={loading}>
76-
Update
77+
{i18n('label.update')}
7778
</Button>
7879
);
7980
}
@@ -85,15 +86,15 @@ class Healthcheck extends React.Component {
8586

8687
const statusOk = selfCheckResult === 'GOOD';
8788
const text = statusOk
88-
? 'No issues have been found on this database.'
89-
: 'Several issues have been found on this database.';
89+
? i18n('status_message.ok')
90+
: i18n('status_message.error');
9091

9192
return (
9293
<div>
9394
<div className={b('status-wrapper')}>
94-
<div className={b('preview-title')}>Healthcheck</div>
95+
<div className={b('preview-title')}>{i18n('title.healthcheck')}</div>
9596
<div className={b('self-check-status-indicator', {[modifier]: true})}>
96-
{statusOk ? 'Ok' : 'Error'}
97+
{statusOk ? i18n('ok') : i18n('error')}
9798
</div>
9899
{this.renderUpdateButton()}
99100
</div>
@@ -105,7 +106,7 @@ class Healthcheck extends React.Component {
105106
onClick={showMoreHandler}
106107
size="s"
107108
>
108-
Show details
109+
{i18n('label.show-details')}
109110
</Button>
110111
)}
111112
</div>
@@ -120,7 +121,7 @@ class Healthcheck extends React.Component {
120121

121122
return (
122123
<div className={b('self-check-status')}>
123-
<h3 className={b('self-check-status-label')}>Self check status</h3>
124+
<h3 className={b('self-check-status-label')}>{i18n('title.self-check-status')}</h3>
124125
<div className={b('self-check-status-indicator', {[modifier]: true})} />
125126
{selfCheckResult}
126127
<div className={b('self-check-update')}>{this.renderUpdateButton()}</div>
@@ -138,7 +139,7 @@ class Healthcheck extends React.Component {
138139

139140
return (
140141
<div className={b('issues')}>
141-
<h3>Issues</h3>
142+
<h3>{i18n('title.issues')}</h3>
142143
<IssuesViewer
143144
issues={issueLog}
144145
showTooltip={showTooltip}
@@ -169,7 +170,7 @@ class Healthcheck extends React.Component {
169170
return this.renderContent();
170171
} else if (loading && !wasLoaded) {
171172
return this.renderLoader();
172-
} else return <div className="error">no healthcheck data</div>;
173+
} else return <div className="error">{i18n('no-data')}</div>;
173174
}
174175
}
175176

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"title.healthcheck": "Healthcheck",
3+
"title.issues": "Issues",
4+
"title.self-check-status": "Self check status",
5+
"label.update": "Update",
6+
"label.show-details": "Show details",
7+
"status_massage.ok": "No issues have been found on this database",
8+
"status_message.error": "Several issues have been found on this database",
9+
"ok": "Ok",
10+
"error": "Error",
11+
"no-data": "no healthcheck data"
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {i18n, Lang} from '../../../../../utils/i18n';
2+
3+
import en from './en.json';
4+
import ru from './ru.json';
5+
6+
const COMPONENT = 'ydb-diagnostics-healthcheck';
7+
8+
i18n.registerKeyset(Lang.En, COMPONENT, en);
9+
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
10+
11+
export default i18n.keyset(COMPONENT);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"title.healthcheck": "Healthcheck",
3+
"title.issues": "Проблемы",
4+
"title.self-check-status": "Статус самопроверки",
5+
"label.update": "Обновить",
6+
"label.show-details": "Посмотреть подробности",
7+
"status_massage.ok": "В базе данных нет проблем",
8+
"status_message.error": "В базе данных есть несколько проблем",
9+
"ok": "Ok",
10+
"error": "Ошибка",
11+
"no-data": "нет данных healthcheck"
12+
}

0 commit comments

Comments
 (0)