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 className={styles.col}>
<label aria-labelledby="changeLangLabel" className={cx(styles.formElement, styles.pullContentRight)}>
<select
defaultValue={this.formatLocale(this.state.settings.locale)}
className={styles.select}
onChange={this.handleSelectChange.bind(this, 'locale', availableLocales)}
>
<option disabled>
{ availableLocales &&
availableLocales.length ?
intl.formatMessage(intlMessages.languageOptionLabel) :
intl.formatMessage(intlMessages.noLocaleOptionLabel) }
</option>
{availableLocales ? availableLocales.map((locale, index) =>
(<option key={index} value={locale.locale}>
{locale.name}
</option>),
) : null }
</select>
{ availableLocales && availableLocales.length > 0 ?
<select
defaultValue={this.formatLocale(this.state.settings.locale)}
className={styles.select}
onChange={this.handleSelectChange.bind(this, 'locale', availableLocales)}
>
<option disabled>
{ intl.formatMessage(intlMessages.languageOptionLabel) }
</option>
{ availableLocales.map((locale, index) =>
(<option key={index} value={locale.locale}>
{locale.name}
</option>),
) }
</select>
: null }
</label>
<div
id="changeLangLabel"