Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[l10n] Auto-mark strings for translation #677

Merged
merged 11 commits into from
Jul 28, 2021
2 changes: 1 addition & 1 deletion src/components/cards/collection-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class CollectionCard extends React.Component<IProps> {
if (repo === Constants.CERTIFIED_REPO) {
return (
<Text component={TextVariants.small}>
<Badge isRead>Certified</Badge>
<Badge isRead>{_`Certified`}</Badge>
</Text>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/namespace-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class NamespaceCard extends React.Component<IProps, {}> {

{namespaceURL && (
<CardFooter>
<Link to={namespaceURL}>View collections</Link>
<Link to={namespaceURL}>{_`View collections`}</Link>
</CardFooter>
)}
</Card>
Expand Down
10 changes: 5 additions & 5 deletions src/components/collection-detail/collection-content-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ export class CollectionContentList extends React.Component<IProps> {
updateParams(ParamHelper.setParam(params, 'keywords', ''))
}
aria-label='find-content'
placeholder='Find content'
placeholder={_`Find content`}
/>
</ToolbarItem>
</ToolbarGroup>
<ToolbarGroup>
<ToolbarItem>Showing:</ToolbarItem>
<ToolbarItem>{_`Showing:`}</ToolbarItem>
{Object.keys(summary).map(key => (
<ToolbarItem
key={key}
Expand All @@ -100,9 +100,9 @@ export class CollectionContentList extends React.Component<IProps> {
<table className='content-table pf-c-table pf-m-compact'>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>{_`Name`}</th>
<th>{_`Type`}</th>
<th>{_`Description`}</th>
</tr>
</thead>
<tbody>
Expand Down
16 changes: 8 additions & 8 deletions src/components/collection-detail/collection-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class CollectionInfo extends React.Component<IProps> {

return (
<div className='pf-c-content info-panel'>
<h1>Install</h1>
<h1>{_`Install`}</h1>
<Grid hasGutter={true}>
<GridItem>{latest_version.metadata.description}</GridItem>
<GridItem>
Expand All @@ -68,13 +68,13 @@ export class CollectionInfo extends React.Component<IProps> {

<GridItem>
<Split hasGutter={true}>
<SplitItem className='install-title'>License</SplitItem>
<SplitItem className='install-title'>{_`License`}</SplitItem>
<SplitItem isFilled>{latest_version.metadata.license}</SplitItem>
</Split>
</GridItem>
<GridItem>
<Split hasGutter={true}>
<SplitItem className='install-tile'>Install Version</SplitItem>
<SplitItem className='install-tile'>{_`Install Version`}</SplitItem>
<SplitItem isFilled>
<FormSelect
onChange={val =>
Expand All @@ -83,7 +83,7 @@ export class CollectionInfo extends React.Component<IProps> {
value={
params.version ? params.version : latest_version.version
}
aria-label='Select collection version'
aria-label={_`Select collection version`}
>
{all_versions.map(v => (
<FormSelectOption
Expand All @@ -102,7 +102,7 @@ export class CollectionInfo extends React.Component<IProps> {
</GridItem>
<GridItem>
<Split hasGutter={true}>
<SplitItem className='install-title'>Installation</SplitItem>
<SplitItem className='install-title'>{_`Installation`}</SplitItem>
<SplitItem isFilled>
<ClipboardCopy isReadOnly>{installCommand}</ClipboardCopy>
<div>
Expand All @@ -124,7 +124,7 @@ export class CollectionInfo extends React.Component<IProps> {
)
}
>
Download tarball
{_`Download tarball`}
</Button>
</div>
</SplitItem>
Expand All @@ -134,7 +134,7 @@ export class CollectionInfo extends React.Component<IProps> {
<GridItem>
<Split hasGutter={true}>
<SplitItem className='install-title'>
Requires Ansible
{_`Requires Ansible`}
</SplitItem>
<SplitItem isFilled>
{latest_version.requires_ansible}
Expand Down Expand Up @@ -165,7 +165,7 @@ export class CollectionInfo extends React.Component<IProps> {
params,
)}
>
Go to documentation
{_`Go to documentation`}
</Link>
</GridItem>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions src/components/collection-detail/table-of-contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class TableOfContents extends React.Component<IProps, IState> {
updateParams(ParamHelper.setParam(params, 'keywords', ''))
}
aria-label='find-content'
placeholder='Find content'
placeholder={_`Find content`}
/>
</ToolbarItem>
</ToolbarGroup>
Expand Down Expand Up @@ -136,7 +136,7 @@ export class TableOfContents extends React.Component<IProps, IState> {
};

table.documentation.push({
display: 'Readme',
display: _`Readme`,
url: formatPath(Paths.collectionDocsIndexByRepo, baseUrlParams),
type: 'docs',
name: 'readme',
Expand Down
4 changes: 2 additions & 2 deletions src/components/collection-list/collection-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export class CollectionFilter extends React.Component<IProps> {
const filterConfig = [
{
id: 'keywords',
title: 'Keywords',
title: _`Keywords`,
},
{
id: 'tags',
title: 'Tag',
title: _`Tag`,
inputType: 'multiple' as 'multiple',
options: Constants.COLLECTION_FILTER_TAGS.map(tag => ({
id: tag,
Expand Down
6 changes: 3 additions & 3 deletions src/components/collection-list/collection-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class CollectionList extends React.Component<IProps> {

return (
<React.Fragment>
<DataList aria-label={'List of Collections'}>
<DataList aria-label={_`List of Collections`}>
{collections.length > 0 ? (
collections.map(c => (
<CollectionListItem
Expand Down Expand Up @@ -90,7 +90,7 @@ export class CollectionList extends React.Component<IProps> {
onClick={() => this.props.handleControlClick(collection.id, 'upload')}
variant='secondary'
>
Upload new version
{_`Upload new version`}
</Button>
<StatefulDropdown
items={[
Expand All @@ -100,7 +100,7 @@ export class CollectionList extends React.Component<IProps> {
}
key='1'
>
{collection.deprecated ? 'Undeprecate' : 'Deprecate'}
{collection.deprecated ? _`Undeprecate` : _`Deprecate`}
</DropdownItem>,
]}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/components/delete-modal/delete-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export class DeleteModal extends React.Component<IProps> {
variant='danger'
isDisabled={isDisabled}
>
Delete
{_`Delete`}
{spinner && <Spinner size='sm'></Spinner>}
</Button>,
<Button key='cancel' onClick={cancelAction} variant='link'>
Cancel
{_`Cancel`}
</Button>,
]}
isOpen={true}
Expand Down
8 changes: 3 additions & 5 deletions src/components/empty-state/empty-state-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ export class EmptyStateFilter extends React.Component<IProps> {
render() {
return (
<EmptyStateCustom
title={'No results found'}
description={
'No results match the filter criteria. Try changing your filter settings.'
}
title={_`No results found`}
description={_`No results match the filter criteria. Try changing your filter settings.`}
icon={SearchIcon}
button={
this.props.clearAllFilters ? (
<Button onClick={this.props.clearAllFilters} variant='link'>
Clear all filters
{_`Clear all filters`}
</Button>
) : null
}
Expand Down
6 changes: 2 additions & 4 deletions src/components/empty-state/empty-state-unauthorized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ export class EmptyStateUnauthorized extends React.Component<IProps> {
return (
<EmptyStateCustom
icon={LockIcon}
title={'You do not have have access to Automation Hub'}
description={
'Contact you organization administrator for more information.'
}
title={_`You do not have have access to Automation Hub`}
description={_`Contact you organization administrator for more information.`}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface IProps {

export class ExecutionEnvironmentHeader extends React.Component<IProps> {
render() {
const tabs = ['Detail', 'Activity', 'Images'];
const tabs = [_`Detail`, _`Activity`, _`Images`];
return (
<BaseHeader
title={this.props.container.name}
Expand All @@ -23,7 +23,7 @@ export class ExecutionEnvironmentHeader extends React.Component<IProps> {
links={[
{
url: Paths.executionEnvironments,
name: 'Container Registry',
name: _`Container Registry`,
},
{ name: this.props.container.name },
]}
Expand Down
18 changes: 11 additions & 7 deletions src/components/execution-environment/repository-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ export class RepositoryForm extends React.Component<IProps, IState> {
variant='large'
onClose={onCancel}
isOpen={true}
title={'Edit repository'}
title={_`Edit repository`}
actions={[
<Button
key='save'
variant='primary'
onClick={() => onSave(description, selectedGroups)}
>
Save
{_`Save`}
</Button>,
<Button key='cancel' variant='link' onClick={onCancel}>
Cancel
{_`Cancel`}
</Button>,
]}
>
<Form>
<FormGroup key='name' fieldId='name' label='Name'>
<FormGroup key='name' fieldId='name' label={_`Name`}>
<TextInput id='name' value={name} isDisabled={true} type='text' />
</FormGroup>
<FormGroup key='name' fieldId='name' label='Container namespace'>
<FormGroup key='name' fieldId='name' label={_`Container namespace`}>
<TextInput
id='name'
value={namespace}
Expand All @@ -72,7 +72,7 @@ export class RepositoryForm extends React.Component<IProps, IState> {
<FormGroup
key='description'
fieldId='description'
label='Description'
label={_`Description`}
>
<TextArea
id='description'
Expand All @@ -88,7 +88,11 @@ export class RepositoryForm extends React.Component<IProps, IState> {
autoResize={true}
/>
</FormGroup>
<FormGroup key='groups' fieldId='groups' label='Groups with access'>
<FormGroup
key='groups'
fieldId='groups'
label={_`Groups with access`}
>
<div className='pf-c-form__helper-text'>
Adding groups provides access to all repositories in the "
{namespace}" container namespace.
Expand Down
8 changes: 4 additions & 4 deletions src/components/group-management/group-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class GroupModal extends React.Component<IProps, IState> {
}}
isOpen={true}
title={''}
header={<h2>Create a group</h2>}
header={<h2>{_`Create a group`}</h2>}
aria-label='group-modal'
actions={[
<Button
Expand All @@ -52,10 +52,10 @@ export class GroupModal extends React.Component<IProps, IState> {
variant='primary'
onClick={() => onSave(this.state.name)}
>
{!this.props.group ? 'Create' : 'Save'}
{!this.props.group ? _`Create` : _`Save`}
</Button>,
<Button key='cancel' variant='link' onClick={() => onCancel()}>
Cancel
{_`Cancel`}
</Button>,
]}
>
Expand All @@ -69,7 +69,7 @@ export class GroupModal extends React.Component<IProps, IState> {
isRequired={true}
key='name'
fieldId='name'
label='Name'
label={_`Name`}
helperTextInvalid={
!this.props.errorMessage ? null : this.props.errorMessage.name
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/headers/base-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class BaseHeader extends React.Component<IProps, {}> {
{imageURL ? (
<Logo
className='image'
alt='Page logo'
alt={_`Page logo`}
image={imageURL}
size='40px'
unlockWidth={true}
Expand Down
Loading