mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 18:40:01 -03:30
Adds proper translation. removes ucFirst()>
This commit is contained in:
parent
b79c686336
commit
8dd4379bf2
@ -81,14 +81,11 @@ class PaginatedDataList extends React.Component {
|
||||
];
|
||||
const queryParams = parseQueryString(qsConfig, location.search);
|
||||
|
||||
const itemDisplayName = ucFirst(itemName);
|
||||
const itemDisplayNamePlural = ucFirst(itemName);
|
||||
|
||||
const dataListLabel = i18n._(t`${itemDisplayName} List`);
|
||||
const dataListLabel = i18n._(t`${itemName} List`);
|
||||
const emptyContentMessage = i18n._(
|
||||
t`Please add ${itemDisplayNamePlural} to populate this list `
|
||||
t`Please add ${itemName} to populate this list `
|
||||
);
|
||||
const emptyContentTitle = i18n._(t`No ${itemDisplayNamePlural} Found `);
|
||||
const emptyContentTitle = i18n._(t`No ${itemName} Found `);
|
||||
|
||||
let Content;
|
||||
if (hasContentLoading && items.length <= 0) {
|
||||
|
||||
@ -151,7 +151,6 @@ class JobList extends Component {
|
||||
} = this.state;
|
||||
const { match, i18n } = this.props;
|
||||
const isAllSelected = selected.length === jobs.length;
|
||||
// const itemName = i18n._(t`Job`);
|
||||
return (
|
||||
<PageSection>
|
||||
<Card>
|
||||
@ -160,7 +159,7 @@ class JobList extends Component {
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={jobs}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount === 1 ? i18n._(t`Job`): i18n._(t`Jobs`)}
|
||||
itemName={itemCount === 1 ? 'Job' : 'Jobs'}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarColumns={[
|
||||
{
|
||||
@ -189,7 +188,7 @@ class JobList extends Component {
|
||||
key="delete"
|
||||
onDelete={this.handleJobDelete}
|
||||
itemsToDelete={selected}
|
||||
itemName={selected.length === 1 ? i18n._(t`Job`): i18n._(t`Jobs`)}
|
||||
itemName={selected.length === 1 ? 'Job' : 'Jobs' }
|
||||
/>,
|
||||
]}
|
||||
/>
|
||||
|
||||
@ -165,7 +165,7 @@ class OrganizationAccess extends React.Component {
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={accessRecords}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount.length === 1 ? i18n._(t`Role`): i18n._(t`Roles`)}
|
||||
itemName={itemCount.length === 1 ? 'Role' : 'Roles'}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarColumns={[
|
||||
{
|
||||
|
||||
@ -153,7 +153,7 @@ class OrganizationsList extends Component {
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={organizations}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount === 1 ? i18n._(t`Organization`): i18n._(t`Organizations`)}
|
||||
itemName={itemCount === 1 ? 'Organization' : 'Organizations'}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarColumns={[
|
||||
{
|
||||
|
||||
@ -204,7 +204,7 @@ class OrganizationNotifications extends Component {
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={notifications}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount.length === 1 ? i18n._(t`Notification`): i18n._(t`Notifications`)}
|
||||
itemName={itemCount.length === 1 ? 'Notification' : 'Notifications'}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarColumns={COLUMNS}
|
||||
renderItem={notification => (
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import { t } from '@lingui/macro';
|
||||
import { withI18n } from '@lingui/react';
|
||||
|
||||
import { OrganizationsAPI } from '@api';
|
||||
import PaginatedDataList from '@components/PaginatedDataList';
|
||||
@ -61,14 +59,13 @@ class OrganizationTeams extends React.Component {
|
||||
|
||||
render() {
|
||||
const { contentError, hasContentLoading, teams, itemCount } = this.state;
|
||||
const { i18n } = this.props;
|
||||
return (
|
||||
<PaginatedDataList
|
||||
contentError={contentError}
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={teams}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount.length === 1 ? i18n._(t`Notification`): i18n._(t`Notifications`)}
|
||||
itemName={itemCount.length === 1 ? 'Notification' : 'Notifications'}
|
||||
qsConfig={QS_CONFIG}
|
||||
/>
|
||||
);
|
||||
@ -80,4 +77,4 @@ OrganizationTeams.propTypes = {
|
||||
};
|
||||
|
||||
export { OrganizationTeams as _OrganizationTeams };
|
||||
export default withI18n()(withRouter(OrganizationTeams));
|
||||
export default withRouter(OrganizationTeams);
|
||||
|
||||
@ -178,7 +178,7 @@ class TemplatesList extends Component {
|
||||
hasContentLoading={hasContentLoading}
|
||||
items={templates}
|
||||
itemCount={itemCount}
|
||||
itemName={itemCount === 1 ? i18n._(t`Template`): i18n._(t`Templates`)}
|
||||
itemName={itemCount === 1 ? 'Template' : 'Templates'}
|
||||
qsConfig={QS_CONFIG}
|
||||
toolbarColumns={[
|
||||
{
|
||||
@ -213,7 +213,7 @@ class TemplatesList extends Component {
|
||||
key="delete"
|
||||
onDelete={this.handleTemplateDelete}
|
||||
itemsToDelete={selected}
|
||||
itemName={selected.length === 1 ? i18n._(t`Template`): i18n._(t`Templates`)}
|
||||
itemName={selected.length === 1 ? 'Template' : 'Templates'}
|
||||
/>,
|
||||
canAdd && (
|
||||
<Dropdown
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user