Skip to content

Commit

Permalink
Better locale check logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Vincent committed Oct 28, 2016
1 parent 9ab8135 commit f24f90d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/js/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ $.each(i18n.fullLocaleList, (i, v) => {
});

// Try to figure out user's language
$('#locales-list').val(app.getLocale() ? app.getLocale().split('-')[0] : 'en');
if (app.getLocale() in i18n.fullLocaleList) {
$('#locales-list').val(app.getLocale());
} else if (app.getLocale().split('-')[0] in i18n.fullLocaleList) {
$('#locales-list').val(app.getLocale().split('-')[0]);
} else {
$('#locales-list').val('en');
}

/* Go button action */
$('#go').click(() => {
Expand Down

0 comments on commit f24f90d

Please sign in to comment.