Fixes for language and scaling

This commit is contained in:
Colin McLeod
2015-09-01 02:20:05 -07:00
parent bf217e7fdd
commit 65f53a3fa4
19 changed files with 696 additions and 568 deletions

View File

@@ -1,6 +1,6 @@
angular.module('app', ['ui.router', 'ct.ui.router.extras.sticky', 'ui.sortable', 'shipyard', 'ngLodash', 'app.templates', 'pascalprecht.translate'])
.run(['$rootScope', '$location', '$window', '$document', '$state', '$translate', 'localeFormat', 'Persist', 'Discounts',
function($rootScope, $location, $window, $doc, $state, $translate, localeFormat, Persist, Discounts) {
.run(['$rootScope', '$location', '$window', '$document', '$state', '$translate', 'localeFormat', 'Persist', 'Discounts', 'Languages',
function($rootScope, $location, $window, $doc, $state, $translate, localeFormat, Persist, Discounts, Languages) {
// App is running as a standalone web app on tablet/mobile
var isStandAlone;
// This was causing issues on Windows phones ($window.external was causing Angular js to throw an exception). Backup is to try this and set isStandAlone to false if this fails.
@@ -33,16 +33,9 @@ function($rootScope, $location, $window, $doc, $state, $translate, localeFormat,
});
$rootScope.language = {
opts: {
en: 'English',
de: 'Deutsh',
es: 'Español',
fr: 'Français',
ru: 'ру́сский язы́к'
},
current: Persist.getLangCode()
opts: Languages,
current: Languages[Persist.getLangCode()] ? Persist.getLangCode() : 'en'
};
$rootScope.localeFormat = d3.locale(localeFormat.get($rootScope.language.current));
updateNumberFormat();