Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1002772 - Don't set document's lang and dir in Homescreen. r=ving…
Browse files Browse the repository at this point in the history
…tetun
  • Loading branch information
stasm committed May 5, 2014
1 parent e8a08a3 commit 481fadf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
14 changes: 2 additions & 12 deletions apps/homescreen/js/homescreen.js
Expand Up @@ -5,14 +5,8 @@ var Homescreen = (function() {
var mode = 'normal';
var origin = document.location.protocol + '//homescreen.' +
document.location.host.replace(/(^[\w\d]+.)?([\w\d]+.[a-z]+)/, '$2');
setLocale();
var iconGrid = document.getElementById('icongrid');

navigator.mozL10n.ready(function localize() {
setLocale();
GridManager.localize();
});

var initialized = false;
onConnectionChange(navigator.onLine);

Expand All @@ -38,6 +32,8 @@ var Homescreen = (function() {
};

GridManager.init(options, function gm_init() {
navigator.mozL10n.ready(GridManager.localize.bind(GridManager));

window.addEventListener('hashchange', function() {
if (!window.location.hash.replace('#', '')) {
return;
Expand Down Expand Up @@ -136,12 +132,6 @@ var Homescreen = (function() {
}
});

function setLocale() {
// set the 'lang' and 'dir' attributes to <html> when the page is translated
document.documentElement.lang = navigator.mozL10n.language.code;
document.documentElement.dir = navigator.mozL10n.language.direction;
}

function onConnectionChange(isOnline) {
var mode = isOnline ? 'online' : 'offline';
document.body.dataset.online = mode;
Expand Down
3 changes: 2 additions & 1 deletion apps/homescreen/test/unit/mock_l10n.js
Expand Up @@ -19,7 +19,8 @@ window.navigator.mozL10n = {
};
},

ready: function() {
ready: function(callback) {
setTimeout(callback);
},

language: {
Expand Down

0 comments on commit 481fadf

Please sign in to comment.