Skip to content

Commit

Permalink
Fix part of #3550: Move translation check from footer to header (#4738)
Browse files Browse the repository at this point in the history
* Move translation to top nav bar.

* Save changes.

* Remove unused.

* Add path to translate.

* Lint.

* Remove cookies import.
  • Loading branch information
tjiang11 authored Feb 27, 2018
1 parent 9a37bba commit b2f102f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ oppia.directive('topNavigationBar', [
'/components/top_navigation_bar/' +
'top_navigation_bar_directive.html'),
controller: [
'$scope', '$http', '$window', '$timeout',
'$scope', '$http', '$window', '$timeout', '$translate',
'SidebarStatusService', 'LABEL_FOR_CLEARING_FOCUS',
'siteAnalyticsService', 'WindowDimensionsService', 'DebouncerService',
function(
$scope, $http, $window, $timeout,
$scope, $http, $window, $timeout, $translate,
SidebarStatusService, LABEL_FOR_CLEARING_FOCUS,
siteAnalyticsService, WindowDimensionsService, DebouncerService) {
if (GLOBALS.userIsLoggedIn && GLOBALS.preferredSiteLanguageCode) {
$translate.use(GLOBALS.preferredSiteLanguageCode);
}
var NAV_MODE_SIGNUP = 'signup';
var NAV_MODES_WITH_CUSTOM_LOCAL_NAV = [
'create', 'explore', 'collection'];
Expand Down
3 changes: 0 additions & 3 deletions core/templates/dev/head/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ oppia.controller('I18nFooter', [
var preferencesDataUrl = '/preferenceshandler/data';
var siteLanguageUrl = '/save_site_language';
$scope.supportedSiteLanguages = constants.SUPPORTED_SITE_LANGUAGES;
if (GLOBALS.userIsLoggedIn && GLOBALS.preferredSiteLanguageCode) {
$translate.use(GLOBALS.preferredSiteLanguageCode);
}

// The $timeout seems to be necessary for the dropdown to show anything
// at the outset, if the default language is not English.
Expand Down

0 comments on commit b2f102f

Please sign in to comment.