Skip to content

Commit fdc4fa0

Browse files
Merge pull request #157 from lokanandaprabhu/feature/SRVKP-6458
SRVKP-6458: Copy missing translations for other locales from console repository
2 parents cb184d7 + 861b960 commit fdc4fa0

10 files changed

+1714
-68
lines changed

locales/en/plugin__pipelines-console-plugin.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"{{taskRunLabel}} details": "{{taskRunLabel}} details",
2222
"<0>{{eventCount}} times in the last <3></3></0>": "<0>{{eventCount}} times in the last <3></3></0>",
2323
"<0>{{eventCount}} times</0>": "<0>{{eventCount}} times</0>",
24-
"<0>{type === 'approve'\n ? 'Are you sure you want to approve'\n : 'Please provide a reason for not approving'} <2></2><3>{name}</3> in <7></7><8></8><9>{pipelineRunName}</9>{type === 'approve' ? '?' : '.'}</0>": "<0>{type === 'approve'\n ? 'Are you sure you want to approve'\n : 'Please provide a reason for not approving'} <2></2><3>{name}</3> in <7></7><8></8><9>{pipelineRunName}</9>{type === 'approve' ? '?' : '.'}</0>",
2524
"Access Mode": "Access Mode",
2625
"Access mode is set by storage class and cannot be changed": "Access mode is set by storage class and cannot be changed",
2726
"Access to": "Access to",
@@ -58,6 +57,7 @@
5857
"Approvers": "Approvers",
5958
"Archived": "Archived",
6059
"Archived in Tekton results": "Archived in Tekton results",
60+
"Are you sure you want to approve": "Are you sure you want to approve",
6161
"Are you sure you want to remove <1>{{selection}}</1> from <4>{{pipelineName}}</4>?": "Are you sure you want to remove <1>{{selection}}</1> from <4>{{pipelineName}}</4>?",
6262
"Authentication type": "Authentication type",
6363
"Average duration": "Average duration",
@@ -172,6 +172,7 @@
172172
"High": "High",
173173
"Image Registry": "Image Registry",
174174
"Image Registry Credentials": "Image Registry Credentials",
175+
"in": "in",
175176
"Increment": "Increment",
176177
"Info": "Info",
177178
"Init containers": "Init containers",
@@ -279,6 +280,7 @@
279280
"PipelineRuns": "PipelineRuns",
280281
"Pipelines": "Pipelines",
281282
"Please <2>try again</2>.": "Please <2>try again</2>.",
283+
"Please provide a reason for not approving": "Please provide a reason for not approving",
282284
"Pod": "Pod",
283285
"Pod selector": "Pod selector",
284286
"Pods": "Pods",

locales/es/plugin__pipelines-console-plugin.json

+335
Large diffs are not rendered by default.

locales/fr/plugin__pipelines-console-plugin.json

+335
Large diffs are not rendered by default.

locales/ja/plugin__pipelines-console-plugin.json

+328-12
Large diffs are not rendered by default.

locales/ko/plugin__pipelines-console-plugin.json

+328-12
Large diffs are not rendered by default.

locales/zh/plugin__pipelines-console-plugin.json

+328-12
Large diffs are not rendered by default.

src/components/approval-tasks/modal/Approval.tsx

+29-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { Trans, useTranslation } from 'react-i18next';
2+
import { useTranslation } from 'react-i18next';
33
import { Formik, FormikValues, FormikHelpers } from 'formik';
44
import { Link } from 'react-router-dom-v5-compat';
55
import { ResourceIcon, k8sPatch } from '@openshift-console/dynamic-plugin-sdk';
@@ -78,32 +78,35 @@ const Approval: ModalComponent<ApprovalProps> = ({
7878

7979
const labelTitle = type === 'approve' ? t('Approve') : t('Reject');
8080

81+
const approvalMessage =
82+
type === 'approve'
83+
? t('Are you sure you want to approve')
84+
: t('Please provide a reason for not approving');
85+
86+
const approvalEnding = type === 'approve' ? '?' : '.';
87+
8188
const labelDescription = (
82-
<Trans t={t} ns="plugin__pipelines-console-plugin">
83-
<p>
84-
{type === 'approve'
85-
? 'Are you sure you want to approve'
86-
: 'Please provide a reason for not approving'}{' '}
87-
<ResourceIcon kind={getReferenceForModel(ApprovalTaskModel)} />
88-
<Link
89-
to={`/k8s/ns/${namespace}/${getReferenceForModel(
90-
ApprovalTaskModel,
91-
)}/${name}`}
92-
>
93-
{name}
94-
</Link>{' '}
95-
{'in'} <br />
96-
<ResourceIcon kind={getReferenceForModel(PipelineRunModel)} />
97-
<Link
98-
to={`/k8s/ns/${namespace}/${getReferenceForModel(
99-
PipelineRunModel,
100-
)}/${pipelineRunName}`}
101-
>
102-
{pipelineRunName}
103-
</Link>
104-
{type === 'approve' ? '?' : '.'}
105-
</p>
106-
</Trans>
89+
<p>
90+
{approvalMessage}{' '}
91+
<ResourceIcon kind={getReferenceForModel(ApprovalTaskModel)} />
92+
<Link
93+
to={`/k8s/ns/${namespace}/${getReferenceForModel(
94+
ApprovalTaskModel,
95+
)}/${name}`}
96+
>
97+
{name}
98+
</Link>{' '}
99+
{t('in')} <br />
100+
<ResourceIcon kind={getReferenceForModel(PipelineRunModel)} />
101+
<Link
102+
to={`/k8s/ns/${namespace}/${getReferenceForModel(
103+
PipelineRunModel,
104+
)}/${pipelineRunName}`}
105+
>
106+
{pipelineRunName}
107+
</Link>
108+
{approvalEnding}
109+
</p>
107110
);
108111
return (
109112
<ModalWrapper className="pipelines-approval-modal" onClose={closeModal}>

src/components/approval-tasks/modal/ApprovalModal.scss

+16
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,19 @@
66
.pipelines-approval-modal__text-box {
77
height: 8rem !important;
88
}
9+
10+
.pipelines-approval-modal__title {
11+
padding-bottom: 0 !important;
12+
padding-left: var(--pf-v5-global--spacer--xl);
13+
padding-top: var(--pf-v5-global--spacer--md);
14+
}
15+
16+
.pipelines-approval-modal__content {
17+
padding-bottom: 0 !important;
18+
padding-left: var(--pf-v5-global--spacer--xl);
19+
}
20+
21+
.pipelines-approval-modal__footer {
22+
padding-top: 0 !important;
23+
padding-left: var(--pf-v5-global--spacer--xl);
24+
}

src/components/approval-tasks/modal/ApprovalModal.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ const ApprovalModal: React.FC<Props> = ({
3636
const dirty = type === 'reject' && _.isEmpty(values.reason);
3737
return (
3838
<Form className="modal-content" onSubmit={handleSubmit}>
39-
<ModalTitle>{labelTitle}</ModalTitle>
40-
<ModalBody>
39+
<ModalTitle className="pipelines-approval-modal__title">
40+
{labelTitle}
41+
</ModalTitle>
42+
<ModalBody className="pipelines-approval-modal__content">
4143
{labelDescription}
4244
<FormGroup label={t('Reason')} fieldId="reason">
4345
<TextArea
@@ -60,6 +62,7 @@ const ApprovalModal: React.FC<Props> = ({
6062
buttonAlignment="left"
6163
cancel={cancel}
6264
errorMessage={status?.error}
65+
className="pipelines-approval-modal__footer"
6366
/>
6467
</Form>
6568
);

src/components/modals/modal.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ export const ModalTitle: React.FC<ModalTitleProps> = ({
3636
</div>
3737
);
3838

39-
export const ModalBody: React.FC<ModalBodyProps> = ({ children }) => (
39+
export const ModalBody: React.FC<ModalBodyProps> = ({
40+
children,
41+
className = 'modal-body-content',
42+
}) => (
4043
<div className="modal-body">
41-
<div className="modal-body-content">{children}</div>
44+
<div className={className}>{children}</div>
4245
</div>
4346
);
4447

@@ -47,10 +50,11 @@ export const ModalFooter: React.FC<ModalFooterProps> = ({
4750
errorMessage,
4851
inProgress,
4952
children,
53+
className = 'modal-footer',
5054
}) => {
5155
return (
5256
<ButtonBar
53-
className="modal-footer"
57+
className={className}
5458
errorMessage={errorMessage}
5559
infoMessage={message}
5660
inProgress={inProgress}

0 commit comments

Comments
 (0)