Skip to content

Commit

Permalink
feat: add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
iso9000t committed Jan 31, 2025
1 parent 472c60c commit 2ec03a4
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 31 deletions.
4 changes: 4 additions & 0 deletions app/localization/translated/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
"DashboardTable.deleteDashboard": "Выдаліць",
"DashboardTable.description": "Апісанне",
"DashboardTable.edit": "Рэдагаваць",
"DashboardTable.duplicate": "Дубляваць",
"DashboardForm.duplicateModalTitle": "Дубляваць дашборд",
"DashboardForm.duplicateModalSubmitButtonText": "Дубляваць",
"DashboardTable.copyConfig": "Скапіраваць канфігурацыю дашборда ў буфер абмену",
"DashboardTable.owner": "Уласнік",
"DefaultProjectSettings.from": "з",
"DefaultProjectSettings.keepAttachments": "Захоўваць скрыншоты",
Expand Down
4 changes: 4 additions & 0 deletions app/localization/translated/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
"DashboardTable.deleteDashboard": "Удалить",
"DashboardTable.description": "Описание",
"DashboardTable.edit": "Редактировать",
"DashboardForm.duplicateModalTitle": "Дублировать дашборд",
"DashboardForm.duplicateModalSubmitButtonText": "Дублировать",
"DashboardTable.duplicate": "Дублировать",
"DashboardTable.copyConfig": "Копировать конфигурацию дашборда в буфер обмена",
"DashboardTable.owner": "Владелец",
"DefaultProjectSettings.from": "с",
"DefaultProjectSettings.keepAttachments": "Сохранять скриншоты",
Expand Down
4 changes: 4 additions & 0 deletions app/localization/translated/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
"DashboardTable.deleteDashboard": "Видалити",
"DashboardTable.description": "Опис",
"DashboardTable.edit": "Редагувати",
"DashboardTable.duplicate": "Дублювати",
"DashboardForm.duplicateModalTitle": "Дублювати дашборд",
"DashboardForm.duplicateModalSubmitButtonText": "Дублювати",
"DashboardTable.copyConfig": "Копіювати конфігурацію дашборду в буфер обміну",
"DashboardTable.owner": "Власник",
"DefaultProjectSettings.from": "з",
"DefaultProjectSettings.keepAttachments": "Зберігати скріншоти",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ import classNames from 'classnames/bind';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { activeProjectSelector } from 'controllers/user';
import { injectIntl, defineMessages } from 'react-intl';
import { injectIntl } from 'react-intl';
import { Grid, ALIGN_CENTER } from 'components/main/grid';
import { EmptyDashboards } from 'pages/inside/dashboardPage/dashboardList/EmptyDashboards';
import { messages } from './messages';
import {
NameColumn,
DescriptionColumn,
Expand All @@ -33,32 +34,6 @@ import {
import styles from './dashboardTable.scss';

const cx = classNames.bind(styles);
const messages = defineMessages({
dashboardName: {
id: 'DashboardTable.dashboardName',
defaultMessage: 'Dashboard Name',
},
description: {
id: 'DashboardTable.description',
defaultMessage: 'Description',
},
owner: {
id: 'DashboardTable.owner',
defaultMessage: 'Owner',
},
duplicate: {
id: 'DashboardTable.duplicate',
defaultMessage: 'Duplicate',
},
edit: {
id: 'DashboardTable.edit',
defaultMessage: 'Edit',
},
deleteDashboard: {
id: 'DashboardTable.deleteDashboard',
defaultMessage: 'Delete',
},
});

@injectIntl
@connect((state) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import { NavLink } from 'components/main/navLink';
import { DASHBOARD_EVENTS } from 'analyticsEvents/dashboardsPageEvents';
import Parser from 'html-react-parser';
import IconDuplicate from 'common/img/duplicate-inline.svg';
import { injectIntl } from 'react-intl';
import styles from './dashboardTable.scss';
import { messages } from './messages';

const cx = classNames.bind(styles);

Expand Down Expand Up @@ -80,7 +82,7 @@ OwnerColumn.defaultProps = {
};

export const DuplicateColumn = track()(
({ value, customProps, className, tracking: { trackEvent } }) => {
injectIntl(({ value, customProps, className, tracking: { trackEvent }, intl }) => {
const [opened, setOpened] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -117,18 +119,18 @@ export const DuplicateColumn = track()(
{opened && (
<div className={cx('hamburger-menu', 'shown')}>
<div className={cx('dropdown-item')} onClick={handleDuplicate}>
Duplicate
{intl.formatMessage(messages.duplicate)}
</div>
<div className={cx('dropdown-item')} onClick={handleCopyConfig}>
Copy dashboard configuration to clipboard
{intl.formatMessage(messages.copyConfig)}
</div>
</div>
)}
</div>
</div>
</div>
);
},
}),
);

DuplicateColumn.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2025 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { defineMessages } from 'react-intl';

export const messages = defineMessages({
dashboardName: {
id: 'DashboardTable.dashboardName',
defaultMessage: 'Dashboard Name',
},
description: {
id: 'DashboardTable.description',
defaultMessage: 'Description',
},
owner: {
id: 'DashboardTable.owner',
defaultMessage: 'Owner',
},
duplicate: {
id: 'DashboardTable.duplicate',
defaultMessage: 'Duplicate',
},
edit: {
id: 'DashboardTable.edit',
defaultMessage: 'Edit',
},
deleteDashboard: {
id: 'DashboardTable.deleteDashboard',
defaultMessage: 'Delete',
},
copyConfig: {
id: 'DashboardTable.copyConfig',
defaultMessage: 'Copy dashboard configuration to clipboard',
},
});

0 comments on commit 2ec03a4

Please sign in to comment.