Skip to content

Commit

Permalink
Task/jenkins 35845 i18n key rename (#579)
Browse files Browse the repository at this point in the history
* [JENKINS-35845] rework i18n keys for home page

* [JENKINS-35845] l10n for activity tab

* [JENKINS-35845] l10n for branches tab

* [JENKINS-35845] l10n for pull requests tab

* [JENKINS-35845] l10n for run details -> pipeline

* [JENKINS-35845] l10n for run details -> changes, tests, artifacts

* [JENKINS-35845] l10n for run details header changes

* [JENKINS-35845] pagination; fix typo causing error
  • Loading branch information
cliffmeyers authored and scherler committed Nov 7, 2016
1 parent 49a9929 commit cd726f8
Show file tree
Hide file tree
Showing 21 changed files with 338 additions and 262 deletions.
31 changes: 16 additions & 15 deletions blueocean-dashboard/src/main/js/components/Activity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EmptyState = ({ repoName, pipeline, showRunButton, onNavigation, t }) =>
<RunButton
runnable={pipeline}
buttonType="run-only"
runLabel={ t('Run.now') }
runLabel={ t('pipelinedetail.activity.button.run') }
onNavigation={onNavigation}
/>
}
Expand Down Expand Up @@ -88,23 +88,24 @@ export class Activity extends Component {
}

const latestRun = runs[0];
const head = 'pipelinedetail.activity.header';

const headers = isMultiBranchPipeline ? [
t('Status'),
t('Build'),
t('Commit'),
{ label: t('Branch'), className: 'branch' },
{ label: t('Message'), className: 'message' },
{ label: t('Duration'), className: 'duration' },
{ label: t('Completed'), className: 'completed' },
t(`${head}.status`),
t(`${head}.build`),
t(`${head}.commit`),
{ label: t(`${head}.branch`), className: 'branch' },
{ label: t(`${head}.message`), className: 'message' },
{ label: t(`${head}.duration`), className: 'duration' },
{ label: t(`${head}.completed`), className: 'completed' },
{ label: '', className: 'actions' },
] : [
t('Status'),
t('Build'),
t('Commit'),
{ label: t('Message'), className: 'message' },
{ label: t('Duration'), className: 'duration' },
{ label: t('Completed'), className: 'completed' },
t(`${head}.status`),
t(`${head}.build`),
t(`${head}.commit`),
{ label: t(`${head}.message`), className: 'message' },
{ label: t(`${head}.duration`), className: 'duration' },
{ label: t(`${head}.completed`), className: 'completed' },
{ label: '', className: 'actions' },
];

Expand Down Expand Up @@ -148,7 +149,7 @@ export class Activity extends Component {
}
{runs.$pager && runs.length > 0 &&
<button disabled={runs.$pending || !runs.$pager.hasMore} className="btn-show-more btn-secondary" onClick={() => runs.$pager.fetchMore()}>
{runs.$pending ? t('Loading') : t('More')}
{runs.$pending ? t('common.pager.loading') : t('common.pager.more')}
</button>
}
</article>
Expand Down
6 changes: 3 additions & 3 deletions blueocean-dashboard/src/main/js/components/Branches.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export default class Branches extends Component {
date={endTime}
liveUpdate
locale={locale}
shortFormat={t('Date.readable.short')}
longFormat={t('Date.readable.long')}
shortFormat={t('common.date.readable.short')}
longFormat={t('common.date.readable.long')}
/>
</td>
{ /* suppress all click events from extension points */ }
Expand All @@ -91,7 +91,7 @@ const { func, object, string } = PropTypes;
Branches.propTypes = {
data: object.isRequired,
t: func,
locale: string
locale: string,
};

Branches.contextTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ export default class ChangeSetToAuthors extends Component {
render() {
const { props: { changeSet, onAuthorsClick, t }, state: { condense } } = this;
const authors = changeSet && changeSet.map ? [...(new Set(changeSet.map(change => change.author.fullName)):any)] : [];
let children = t('No.changes');
let children = t('rundetail.header.changes.none');
if (authors && authors.length > 0) {
let nested;
if (condense) {
nested = t('Changes.condense', { 0: changeSet.length });
nested = t('rundetail.header.changes.count', { 0: changeSet.length });
} else {
nested = t('Changes.by', { 0: authors.map(author => ` ${author}`) });
nested = t('rundetail.header.changes.names', { 0: authors.map(author => ` ${author}`) });
}
children = (<a className="authors" onClick={onAuthorsClick}>
{nested}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function CreatePipelineLink(props, context) {

return (
<Link to="/create-pipeline" className="btn-secondary inverse">
{ translate('New Pipeline') }
{ translate('home.header.button.createpipeline') }
</Link>
);
}
Expand Down
16 changes: 9 additions & 7 deletions blueocean-dashboard/src/main/js/components/MultiBranch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ export class MultiBranch extends Component {
return (<EmptyState t={t} repoName={this.context.params.pipeline} />);
}

const head = 'pipelinedetail.branches.header';

const headers = [
t('Health'),
t('Status'),
{ label: t('Branch'), className: 'branch' },
{ label: t('Commit'), className: 'lastcommit' },
{ label: t('Latest.message'), className: 'message' },
{ label: t('Completed'), className: 'completed' },
t(`${head}.health`),
t(`${head}.status`),
{ label: t(`${head}.branch`), className: 'branch' },
{ label: t(`${head}.commit`), className: 'lastcommit' },
{ label: t(`${head}.message`), className: 'message' },
{ label: t(`${head}.completed`), className: 'completed' },
{ label: '', className: 'run' },
];

Expand All @@ -104,7 +106,7 @@ export class MultiBranch extends Component {
</Table>
{branches.$pager &&
<button disabled={branches.$pending || !branches.$pager.hasMore} className="btn-show-more btn-secondary" onClick={() => branches.$pager.fetchMore()}>
{branches.$pending ? t('Loading') : t('More')}
{branches.$pending ? t('common.pager.loading') : t('common.pager.more')}
</button>
}
</article>
Expand Down
6 changes: 3 additions & 3 deletions blueocean-dashboard/src/main/js/components/PipelinePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export class PipelinePage extends Component {
}

<PageTabs base={baseUrl}>
<TabLink to="/activity">{ t('Activity') }</TabLink>
<TabLink to="/branches">{ t('Branches') }</TabLink>
<TabLink to="/pr">{ t('PR') }</TabLink>
<TabLink to="/activity">{ t('pipelinedetail.common.tab.activity') }</TabLink>
<TabLink to="/branches">{ t('pipelinedetail.common.tab.branches') }</TabLink>
<TabLink to="/pr">{ t('pipelinedetail.common.tab.pullrequests') }</TabLink>
</PageTabs>
</PageHeader>
{isReady && React.cloneElement(this.props.children, { pipeline, setTitle, t, locale: I18n.language })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export class PipelineRowItem extends Component {
const { t } = this.props;
let response = '-';
if (failing > 0) {
response = t('Failing', { 0: failing });
response = t('home.pipelineslist.row.failing', { 0: failing });
} else if (passing > 0) {
response = t('Passing', { 0: passing });
response = t('home.pipelineslist.row.passing', { 0: passing });
}
return response;
}
Expand Down
16 changes: 8 additions & 8 deletions blueocean-dashboard/src/main/js/components/Pipelines.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export class Pipelines extends Component {
// this.i18n.on('i18nChanged', (date) => {
// console.log('xxx - i18nChanged', date);
// });
// this.i18n.t && console.log('xxxx', this.i18n.t('Name'))
// this.i18n.t && console.log('xxxx', this.i18n.t('home.pipelineslist.header.name'))
const { t } = new I18nWrapper('jenkins.plugins.blueocean.dashboard.Messages');
console.log('ttt'). t('Name')
console.log('ttt', t('home.pipelineslist.header.name'));
const orgLink = organization ?
<Link
to={`organizations/${organization}`}
Expand All @@ -37,10 +37,10 @@ console.log('ttt'). t('Name')
</Link> : '';

const headers = [
{ label: t('Name'), className: 'name-col' },
t('Health'),
t('Branches'),
t('PR'),
{ label: t('home.pipelineslist.header.name'), className: 'name-col' },
t('home.pipelineslist.header.health'),
t('home.pipelineslist.header.branches'),
t('home.pipelineslist.header.pullrequests'),
{ label: '', className: 'actions-col' },
];

Expand All @@ -56,7 +56,7 @@ console.log('ttt'). t('Name')
query={query}
className="inverse"
>
{ t('Dashboard') }
{ t('home.header.dashboard') }
</Link>
{ organization && ' / ' }
{ organization && orgLink }
Expand Down Expand Up @@ -94,7 +94,7 @@ console.log('ttt'). t('Name')

{ pipelines && pipelines.$pager &&
<button disabled={!pipelines.$pager.hasMore} className="btn-show-more btn-secondary" onClick={() => pipelines.$pager.fetchMore()}>
{pipelines.$pending ? t('Loading') : t('More')}
{pipelines.$pending ? t('common.pager.loading') : t('common.pager.more')}
</button>
}
</article>
Expand Down
4 changes: 2 additions & 2 deletions blueocean-dashboard/src/main/js/components/PullRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export default class PullRequest extends Component {
date={endTime}
liveUpdate
locale={locale}
shortFormat={t('Date.readable.short')}
longFormat={t('Date.readable.long')}
shortFormat={t('common.date.readable.short')}
longFormat={t('common.date.readable.long')}
/>
</td>
<td>
Expand Down
12 changes: 7 additions & 5 deletions blueocean-dashboard/src/main/js/components/PullRequests.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ export class PullRequests extends Component {
return (<EmptyState t={t} repoName={this.context.params.pipeline} />);
}

const head = 'pipelinedetail.pullrequests.header';

const headers = [
t('Status'),
{ label: t('Latest.build'), className: 'build' },
{ label: t('Summary'), className: 'summary' },
t('Author'),
{ label: t('Completed'), className: 'completed' },
t(`${head}.status`),
{ label: t(`${head}.build`), className: 'build' },
{ label: t(`${head}.summary`), className: 'summary' },
t(`${head}.author`),
{ label: t(`${head}.completed`), className: 'completed' },
{ label: '', className: 'run' },
];

Expand Down
8 changes: 4 additions & 4 deletions blueocean-dashboard/src/main/js/components/RunDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ class RunDetails extends Component {
onAuthorsClick={() => this.navigateToChanges()}
/>
<PageTabs base={baseUrl}>
<TabLink to="/pipeline">{t('Pipeline')}</TabLink>
<TabLink to="/changes">{t('Changes')}</TabLink>
<TabLink to="/tests">{t('Tests')}</TabLink>
<TabLink to="/artifacts">{t('Artifacts')}</TabLink>
<TabLink to="/pipeline">{t('rundetail.header.tab.pipeline')}</TabLink>
<TabLink to="/changes">{t('rundetail.header.tab.changes')}</TabLink>
<TabLink to="/tests">{t('rundetail.header.tab.tests')}</TabLink>
<TabLink to="/artifacts">{t('rundetail.header.tab.artifacts')}</TabLink>
</PageTabs>

<div className="button-bar">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export default class RunDetailsArtifacts extends Component {
}

const headers = [
{ label: t('Name'), className: 'name' },
{ label: t('Size'), className: 'size' },
{ label: t('rundetail.artifacts.header.name'), className: 'name' },
{ label: t('rundetail.artifacts.header.size'), className: 'size' },
{ label: '', className: 'actions' },
];

Expand All @@ -42,7 +42,7 @@ export default class RunDetailsArtifacts extends Component {
<FileSize bytes={artifact.size} />
</td>
<td className="download">
<a target="_blank" title={t('Download.artifact')} href={artifact.url}>
<a target="_blank" title={t('rundetail.artifacts.button.download')} href={artifact.url}>
<Icon style={style} icon="file_download" />
</a>
</td>
Expand Down
14 changes: 8 additions & 6 deletions blueocean-dashboard/src/main/js/components/RunDetailsChanges.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ export default class RunDetailsChanges extends Component {
</EmptyStateView>);
}

const head = 'rundetail.changes.header';

const headers = [
t('Commit'),
{ label: t('Author'), className: 'author' },
{ label: t('Message'), className: 'message' },
{ label: t('Date'), className: 'date' },
t(`${head}.commit`),
{ label: t(`${head}.author`), className: 'author' },
{ label: t(`${head}.message`), className: 'message' },
{ label: t(`${head}.date`), className: 'date' },
];

return (
Expand All @@ -49,8 +51,8 @@ export default class RunDetailsChanges extends Component {
date={commit.timestamp}
liveUpdate
locale={locale}
shortFormat={t('Date.readable.short')}
longFormat={t('Date.readable.long')}
shortFormat={t('common.date.readable.short')}
longFormat={t('common.date.readable.long')}
/>
</td>
</tr>
Expand Down
12 changes: 6 additions & 6 deletions blueocean-dashboard/src/main/js/components/RunDetailsHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ class RunDetailsHeader extends Component {
<div className="row">
<div className="commons">
<div>
<label>{ t('Branch') }</label>
<label>{ t('rundetail.header.branch') }</label>
<span>{displayName}</span>
</div>
{ run.commitId ?
<div>
<label>{t('Commit')}</label>
<label>{t('rundetail.header.commit')}</label>
<span className="commit">
{run.commitId.substring(0, 7)}
</span>
Expand All @@ -84,8 +84,8 @@ class RunDetailsHeader extends Component {
liveUpdate={run.isRunning()}
updatePeriod={1000}
locale={locale}
liveFormat={t('Date.duration.format')}
hintFormat={t('Date.duration.hint.format')}
liveFormat={t('common.date.duration.format')}
hintFormat={t('common.date.duration.hint.format')}
/>
</div>
<div>
Expand All @@ -99,8 +99,8 @@ class RunDetailsHeader extends Component {
date={run.endTime}
liveUpdate
locale={locale}
shortFormat={t('Date.readable.short')}
longFormat={t('Date.readable.long')}
shortFormat={t('common.date.readable.short')}
longFormat={t('common.date.readable.long')}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export class RunDetailsPipeline extends Component {
}
{ isPipelineQueued && supportsNode && <QueuedState /> }
{ !isPipelineQueued && hasResultsForSteps && noSteps && !this.mergedConfig.forceLogView && <EmptyStateView tightSpacing>
<p>{t('noSteps')}</p>
<p>{t('rundetail.pipeline.nosteps')}</p>
</EmptyStateView>
}
{ ((!hasResultsForSteps && !isPipelineQueued) || !supportsNode || this.mergedConfig.forceLogView) && <LogConsoleView
Expand Down
10 changes: 5 additions & 5 deletions blueocean-dashboard/src/main/js/components/RunDetailsTests.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class RunDetailsTests extends Component {
if (!testResults || testResults.$pending) {
return <PageLoading />;
}

if (testResults.$failed) {
return (<EmptyStateView tightSpacing>
<Markdown>
Expand All @@ -41,10 +41,10 @@ export class RunDetailsTests extends Component {
return (<div className="test-results-container">
<div className="test=result-summary" style={{ display: 'none' }}>
<div className={`test-result-bar ${percentComplete}%`}></div>
<div className="test-result-passed">{t('Passed', { 0: testResults.passCount })}</div>
<div className="test-result-failed">{t('Failed', { 0: testResults.failCount })}</div>
<div className="test-result-skipped">{t('Skipped', { 0: testResults.skipCount })}</div>
<div className="test-result-duration">{t('Duration.param', { 0: testResults.duration })}</div>
<div className="test-result-passed">{t('rundetail.tests.passed', { 0: testResults.passCount })}</div>
<div className="test-result-failed">{t('rundetail.tests.failed', { 0: testResults.failCount })}</div>
<div className="test-result-skipped">{t('rundetail.tests.skipped', { 0: testResults.skipCount })}</div>
<div className="test-result-duration">{t('rundetail.tests.duration', { 0: testResults.duration })}</div>
</div>

<Extensions.Renderer
Expand Down
8 changes: 4 additions & 4 deletions blueocean-dashboard/src/main/js/components/Runs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ export default class Runs extends Component {
millis={durationMillis}
liveUpdate={running}
locale={locale}
liveFormat={t('Date.duration.format')}
hintFormat={t('Date.duration.hint.format')}
liveFormat={t('common.date.duration.format')}
hintFormat={t('common.date.duration.hint.format')}
/>
</td>
<td>
<ReadableDate
date={endTime}
liveUpdate
locale={locale}
shortFormat={t('Date.readable.short')}
longFormat={t('Date.readable.long')}
shortFormat={t('common.date.readable.short')}
longFormat={t('common.date.readable.long')}
/>
</td>
<td>
Expand Down
Loading

0 comments on commit cd726f8

Please sign in to comment.