mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 11:27:36 -02:30
Add translations to AnsibleSelect
This commit is contained in:
@@ -52,7 +52,7 @@ class About extends React.Component {
|
|||||||
<AboutModal
|
<AboutModal
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
productName={i18n._(t`Ansible Tower`)}
|
productName="Ansible Tower"
|
||||||
trademark={i18n._(t`Copyright 2018 Red Hat, Inc.`)}
|
trademark={i18n._(t`Copyright 2018 Red Hat, Inc.`)}
|
||||||
brandImageSrc={brandImg}
|
brandImageSrc={brandImg}
|
||||||
brandImageAlt={i18n._(t`Brand Image`)}
|
brandImageAlt={i18n._(t`Brand Image`)}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { I18n } from '@lingui/react';
|
||||||
|
import { t } from '@lingui/macro';
|
||||||
import {
|
import {
|
||||||
FormSelect,
|
FormSelect,
|
||||||
FormSelectOption,
|
FormSelectOption,
|
||||||
@@ -21,11 +22,15 @@ class AnsibleSelect extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
const { label, value, data, defaultSelected } = this.props;
|
const { label, value, data, defaultSelected } = this.props;
|
||||||
return (
|
return (
|
||||||
<FormSelect value={value} onChange={this.onSelectChange} aria-label="Select Input">
|
<I18n>
|
||||||
{data.map((datum) => (datum === defaultSelected
|
{({ i18n }) => (
|
||||||
? (<FormSelectOption key="" value="" label={`Use Default ${label}`} />) : (<FormSelectOption key={datum} value={datum} label={datum} />)))
|
<FormSelect value={value} onChange={this.onSelectChange} aria-label={i18n._(t`Select Input`)}>
|
||||||
}
|
{data.map((datum) => (datum === defaultSelected
|
||||||
</FormSelect>
|
? (<FormSelectOption key="" value="" label={i18n._(t`Use Default ${label}`)} />) : (<FormSelectOption key={datum} value={datum} label={datum} />)))
|
||||||
|
}
|
||||||
|
</FormSelect>
|
||||||
|
)}
|
||||||
|
</I18n>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user