diff --git a/app/js/filters.js b/app/js/filters.js index deb26185..e5f55662 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -51,17 +51,14 @@ angular.module('myApp.filters', ['myApp.i18n']) } }]) - .filter('dateOrTime', ['$filter', '_', function($filter, _) { + .filter('dateOrTime', ['$filter', function($filter) { var cachedDates = {}, dateFilter = $filter('date'); return function (timestamp) { - if (!cachedDates.hasOwnProperty(_.locale())) { - cachedDates[_.locale()] = {}; - } - if (cachedDates[_.locale()][timestamp]) { - return cachedDates[_.locale()][timestamp]; + if (cachedDates[timestamp]) { + return cachedDates[timestamp]; } var ticks = timestamp * 1000, @@ -74,42 +71,34 @@ angular.module('myApp.filters', ['myApp.i18n']) else if (diff > 43200000) { // 12 hours format = 'EEE'; } - return cachedDates[_.locale()][timestamp] = dateFilter(ticks, format); + return cachedDates[timestamp] = dateFilter(ticks, format); } }]) - .filter('time', ['$filter', '_', function($filter, _) { + .filter('time', ['$filter', function($filter) { var cachedDates = {}, dateFilter = $filter('date'), format = Config.Mobile ? 'HH:mm' : 'HH:mm:ss'; return function (timestamp) { - if (!cachedDates.hasOwnProperty(_.locale())) { - cachedDates[_.locale()] = {}; - } - - if (cachedDates[_.locale()][timestamp]) { - return cachedDates[_.locale()][timestamp]; + if (cachedDates[timestamp]) { + return cachedDates[timestamp]; } - return cachedDates[_.locale()][timestamp] = dateFilter(timestamp * 1000, format); + return cachedDates[timestamp] = dateFilter(timestamp * 1000, format); } }]) - .filter('myDate', ['$filter', '_', function($filter, _) { + .filter('myDate', ['$filter', function($filter) { var cachedDates = {}, dateFilter = $filter('date'); return function (timestamp) { - if (!cachedDates.hasOwnProperty(_.locale())) { - cachedDates[_.locale()] = {}; - } - - if (cachedDates[_.locale()][timestamp]) { - return cachedDates[_.locale()][timestamp]; + if (cachedDates[timestamp]) { + return cachedDates[timestamp]; } - return cachedDates[_.locale()][timestamp] = dateFilter(timestamp * 1000, 'fullDate'); + return cachedDates[timestamp] = dateFilter(timestamp * 1000, 'fullDate'); } }]) diff --git a/app/js/init.js b/app/js/init.js index 0ffd32fb..d4b2138d 100644 --- a/app/js/init.js +++ b/app/js/init.js @@ -78,7 +78,7 @@ defaultLocale = 'en-us', bootReady = { dom: false, - i18n_ng: Config.I18n.locale == defaultLocale, // Already included + i18n_ng: locale == defaultLocale, // Already included i18n_messages: false, i18n_fallback: false }, @@ -114,13 +114,12 @@ } if (!bootReady.i18n_ng) { - $('head').append($('