Merge pull request #7261 from bocoup/issue-7173

Fix gh-7173: The select element in the footer needs proper aria labeling
This commit is contained in:
Benjamin Wheeler 2022-12-13 22:35:44 -05:00 committed by GitHub
commit 65ac31822e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -1,5 +1,7 @@
const bindAll = require('lodash.bindall');
const classNames = require('classnames');
const injectIntl = require('react-intl').injectIntl;
const intlShape = require('react-intl').intlShape;
const PropTypes = require('prop-types');
const React = require('react');
@ -37,6 +39,7 @@ class LanguageChooser extends React.Component {
<Form className={classNames('language-chooser', this.props.className)}>
<Select
required
aria-label={this.props.intl.formatMessage({id: 'general.languageChooser'})}
name="language"
options={languageOptions}
value={this.props.locale}
@ -50,7 +53,8 @@ class LanguageChooser extends React.Component {
LanguageChooser.propTypes = {
className: PropTypes.string,
languages: PropTypes.object, // eslint-disable-line react/forbid-prop-types
locale: PropTypes.string
locale: PropTypes.string,
intl: intlShape
};
LanguageChooser.defaultProps = {
@ -58,4 +62,4 @@ LanguageChooser.defaultProps = {
locale: 'en'
};
module.exports = LanguageChooser;
module.exports = injectIntl(LanguageChooser);

View file

@ -1,4 +1,5 @@
{
"general.languageChooser": "Select Language",
"general.accountSettings": "Account settings",
"general.about": "About",
"general.aboutScratch": "About Scratch",