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