Fixed the default locale issue.

This commit is contained in:
Maxim Khlobystov 2017-11-24 20:26:03 +00:00
parent b8684d74d6
commit 864e71798d

View File

@ -183,23 +183,22 @@ class ApplicationMenu extends BaseMenu {
</div> </div>
<div className={styles.col}> <div className={styles.col}>
<label aria-labelledby="changeLangLabel" className={cx(styles.formElement, styles.pullContentRight)}> <label aria-labelledby="changeLangLabel" className={cx(styles.formElement, styles.pullContentRight)}>
<select { availableLocales && availableLocales.length > 0 ?
defaultValue={this.formatLocale(this.state.settings.locale)} <select
className={styles.select} defaultValue={this.formatLocale(this.state.settings.locale)}
onChange={this.handleSelectChange.bind(this, 'locale', availableLocales)} className={styles.select}
> onChange={this.handleSelectChange.bind(this, 'locale', availableLocales)}
<option disabled> >
{ availableLocales && <option disabled>
availableLocales.length ? { intl.formatMessage(intlMessages.languageOptionLabel) }
intl.formatMessage(intlMessages.languageOptionLabel) : </option>
intl.formatMessage(intlMessages.noLocaleOptionLabel) } { availableLocales.map((locale, index) =>
</option> (<option key={index} value={locale.locale}>
{availableLocales ? availableLocales.map((locale, index) => {locale.name}
(<option key={index} value={locale.locale}> </option>),
{locale.name} ) }
</option>), </select>
) : null } : null }
</select>
</label> </label>
<div <div
id="changeLangLabel" id="changeLangLabel"