diff --git a/nailgun/static/js/views/common.js b/nailgun/static/js/views/common.js index 084c9a56a6..bfa00964fc 100644 --- a/nailgun/static/js/views/common.js +++ b/nailgun/static/js/views/common.js @@ -259,9 +259,16 @@ function(utils, models, dialogViews, navbarTemplate, nodesStatsTemplate, notific window.location.reload(); }, getCurrentLocale: function() { - return _.find(this.locales, {locale: $.i18n.lng()}) || this.locales[0]; + return _.find(this.locales, {locale: $.i18n.lng()}); + }, + setDefaultLocale: function() { + var currentLocale = this.getCurrentLocale(); + if (!currentLocale) { + $.i18n.setLng(this.locales[0].locale); + } }, initialize: function(options) { + this.setDefaultLocale(); $.ajax({url: '/api/version'}).done(_.bind(function(data) { this.version = data.release; this.render();