1
0
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:
Marliana Lara 2019-02-19 14:24:36 -05:00
parent 7567a6b36a
commit 9229c8e724
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
2 changed files with 12 additions and 7 deletions

View File

@ -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`)}

View File

@ -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>
);
}
}