Skip to content

Commit

Permalink
fix: fix i18n in dop (#4048)
Browse files Browse the repository at this point in the history
  • Loading branch information
laojun authored Jun 28, 2024
1 parent e97603f commit 10a63ee
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 34 deletions.
4 changes: 2 additions & 2 deletions shell/app/config-page/components/api-editor/api-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@

.ace_gutter {
width: 48px;
padding-right: 13px;
padding-left: 19px;
padding-right: 8px;
padding-left: 8px;
}

&.ace_show_gutter .ace_line {
Expand Down
2 changes: 1 addition & 1 deletion shell/app/config-page/components/bubble-graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const CP_BubbleGraph: React.FC<CP_BUBBLE_GRAPH.Props> = (props) => {
{option.series.length && option.yAxis.length ? (
<Echarts onEvents={onEvents} option={option} style={style} />
) : (
<EmptyHolder relative />
<EmptyHolder relative style={{ height: 170 }} />
)}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion shell/app/config-page/components/line-graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const LineGraph: React.FC<CP_LINE_GRAPH.Props> = (props) => {
}}
/>
) : (
<EmptyHolder relative />
<EmptyHolder relative style={{ height: 170 }} />
)}
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions shell/app/modules/application/pages/pipeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ const AppPipeline = () => {
type="info"
message={
<span>
{i18n.s(
'The new pipeline page is in the trial stage, and you can still manually switch to the old version for use.',
'dop',
{i18n.t(
'dop:The new pipeline page is in the trial stage, and you can still manually switch to the old version for use.',
)}
<span
onClick={() => {
goTo('../obsoleted');
}}
className="text-purple-deep cursor-pointer"
>
{i18n.s('Switch to old version', 'dop')}
{i18n.t('dop:Switch to old version')}
</span>
</span>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ const Pipeline = () => {
type="info"
message={
<span className="">
{i18n.s(
'The new pipeline page is in the trial stage, you can manually switch to the new version to experience.',
'dop',
{i18n.t(
'dop:The new pipeline page is in the trial stage, you can manually switch to the new version to experience.',
)}
<span
onClick={() => {
goTo(goTo.pages.pipelineNewRoot);
}}
className="text-purple-deep cursor-pointer"
>
{i18n.s('Try it right now', 'dop')}
{i18n.t('dop:Try it right now')}
</span>
</span>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ export const EditIssueDrawer = (props: IProps) => {
confirmCloseTip={
isEditMode
? isContentChanged
? i18n.s('The edit data will be lost if closed. Continue?', 'dop')
? i18n.t('dop:The edit data will be lost if closed. Continue?')
: undefined
: i18n.t('dop:The new data will be lost if closed. Continue?')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export const EDIT_PROPS = {
contentLabel: i18n.t('dop:task description'),
},
[ISSUE_TYPE.BUG]: {
titlePlaceHolder: i18n.s('input the bug name', 'dop'),
titlePlaceHolder: i18n.t('dop:input the bug name'),
contentLabel: i18n.t('dop:Description'),
},
[ISSUE_TYPE.TICKET]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Info = (props: IProps) => {
},
},
{
label: i18n.s('Owner', 'dop'),
label: i18n.t('dop:Owner'),
valueKey: 'owner',
valueItem: ({ value: val }: { value: string }) => {
const curUser = userMap[val];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const PipelineForm = ({ onCancel, pipelineCategory, onOk, data: editData, fixedA
},
},
{
label: i18n.s('default pipeline', 'dop'),
label: i18n.t('dop:default pipeline'),
name: 'isDefault',
type: 'switch',
itemProps: {
Expand All @@ -302,7 +302,7 @@ const PipelineForm = ({ onCancel, pipelineCategory, onOk, data: editData, fixedA
},
},
{
label: i18n.s('pipeline name', 'dop'),
label: i18n.t('dop:pipeline name'),
name: 'pipelineName',
itemProps: {
disabled: disabledName,
Expand All @@ -314,14 +314,13 @@ const PipelineForm = ({ onCancel, pipelineCategory, onOk, data: editData, fixedA
let errMsg;
if (value) {
if (!value.endsWith('.yml')) {
errMsg = i18n.s('pipeline name must end with .yml', 'dop');
errMsg = i18n.t('dop:pipeline name must end with .yml');
} else if (
pipelineCategoryKey === 'others' &&
['pipeline.yml', 'ci-artifact.yml', 'combine-artifact.yml', 'integration.yml'].includes(value)
) {
errMsg = i18n.s(
'can not be special name:pipeline.yml, ci-artifact.yml, combine-artifact.yml, integration.yml',
'dop',
errMsg = i18n.t(
'dop:can not be special name:pipeline.yml, ci-artifact.yml, combine-artifact.yml, integration.yml',
);
}
}
Expand Down Expand Up @@ -535,7 +534,7 @@ const PipelineForm = ({ onCancel, pipelineCategory, onOk, data: editData, fixedA
treeTitle ? 'text-default-8' : 'text-default-4'
} h-[32px] rounded bg-default-06 w-full px-3 py-[5px]`}
>
{treeTitle || (curApp ? i18n.s('Please choose a pipeline', 'dop') : '')}
{treeTitle || (curApp ? i18n.t('dop:Please choose a pipeline') : '')}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ const PipelineProtocol = React.forwardRef(
},
{ title: i18n.t('dop:branch'), dataIndex: 'branch' },
{
title: i18n.s('Trigger infor', 'dop'),
title: i18n.t('dop:Trigger infor'),
dataIndex: 'executor',
render: (val: string, record: PipelineRecord) => {
const { triggerMode } = record;
const { nick, name } = userMap[val] || {};
const text =
triggerMode === 'cron'
? i18n.s('automatic execution', 'dop')
: `${nick || name || i18n.t('common:None')} ${i18n.s('manually execution', 'dop')}`;
? i18n.t('dop:automatic execution')
: `${nick || name || i18n.t('common:None')} ${i18n.t('dop:manually execution')}`;
return text;
},
},
Expand Down Expand Up @@ -423,7 +423,7 @@ const PipelineProtocol = React.forwardRef(
}
}}
>
{i18n.s('Check more records', 'dop')}
{i18n.t('dop:Check more records')}
</span>
</div>
) : null}
Expand All @@ -433,7 +433,7 @@ const PipelineProtocol = React.forwardRef(
<div className="flex-h-center group text-sm cursor-pointer">
<Badge
showDot={false}
text={isLatestPipeline ? i18n.s('newest', 'dop') : i18n.s('history', 'dop')}
text={isLatestPipeline ? i18n.t('dop:newest') : i18n.t('dop:history')}
status={isLatestPipeline ? 'processing' : 'warning'}
className="mr-1"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const Info = ({ appId }: { appId: string }) => {
)}
<Col span={12}>
{ownerName ? <Avatar name={ownerName} showName className="mb-1" size={20} /> : '-'}
<div className="info-label">{i18n.s('Owner', 'dop')}</div>
<div className="info-label">{i18n.t('dop:Owner')}</div>
</Col>
</Row>
<div className="trigger-btn" onClick={toggleExpandInfo}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const AddFlow: React.FC<IProps> = ({ onAdd, issueId, flow, children }) => {
<Badge
size="small"
showDot={false}
text={i18n.s('exist', 'dop')}
text={i18n.t('dop:exist')}
status={'success'}
className="mr-1"
/>
Expand Down
2 changes: 1 addition & 1 deletion shell/app/modules/project/common/issue-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const EDIT_PROPS = {
contentLabel: i18n.t('dop:task description'),
},
[ISSUE_TYPE.BUG]: {
titlePlaceHolder: i18n.s('input the bug name', 'dop'),
titlePlaceHolder: i18n.t('dop:input the bug name'),
contentLabel: i18n.t('dop:Description'),
},
[ISSUE_TYPE.TICKET]: {
Expand Down
5 changes: 2 additions & 3 deletions shell/app/modules/project/pages/deploy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,8 @@ const DeployContent = ({
type="info"
message={
<span>
{i18n.s(
'Current environment only supports {supportedBranches} branch for deployment, and there are no restrictions on product deployment. For detailed settings, please refer to Project Settings-R&D Workflow Settings',
'dop',
{i18n.t(
'dop:Current environment only supports {supportedBranches} branch for deployment, and there are no restrictions on product deployment. For detailed settings, please refer to Project Settings-R&D Workflow Settings',
{ supportedBranches, interpolation: { escapeValue: false } },
)}
</span>
Expand Down
2 changes: 1 addition & 1 deletion shell/app/modules/project/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function getProjectRouter(): RouteConfigItem[] {
routes: [
{
path: 'records',
breadcrumbName: i18n.s('Workflow Records', 'dop'),
breadcrumbName: i18n.t('dop:Workflow Records'),
getComp: (cb) => cb(import('project/pages/flow/records')),
},
],
Expand Down

0 comments on commit 10a63ee

Please sign in to comment.