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