forked from EyeSeeTea/msf_appproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
87 lines (72 loc) · 3.01 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
Copyright (c) 2016.
This file is part of Project Configuration for MSF.
Project Configuration is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Configuration is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Project Configuration. If not, see <http://www.gnu.org/licenses/>. */
var appConfigProjectMSF = angular.module("appConfigProjectMSF", ['ngRoute','Dhis2Api','pascalprecht.translate','ui.bootstrap','d2Menu', 'angularFileUpload','angularTreeview','angular-md5']);
appConfigProjectMSF.config(function($routeProvider) {
$routeProvider.when('/InternationalMSF', {
templateUrl: "modules/InternationalMSF/internationalMSFView.html",
controller: "internationalMSFController"
});
$routeProvider.when('/Disabled', {
templateUrl: "modules/disabledOU/disabledView.html",
controller: "disabledController"
});
$routeProvider.when('/OperationalCenter', {
templateUrl: "modules/OperationalCenter/operationalCenterView.html",
controller: "operationalCenterController"
});
$routeProvider.when('/Mission', {
templateUrl: "modules/Mission/missionView.html",
controller: "missionController"
});
$routeProvider.when('/Project', {
templateUrl: "modules/Project/projectView.html",
controller: "projectController"
});
$routeProvider.when('/HealthSite', {
templateUrl: "modules/HealthSite/healthSiteView.html",
controller: "healthSiteController"
});
$routeProvider.when('/HealthService', {
templateUrl: "modules/HealthService/healthServiceView.html",
controller: "healthServiceController"
});
$routeProvider.otherwise({
redirectTo: '/'
});
});
appConfigProjectMSF.config(function ($translateProvider, urlApi) {
$translateProvider.useStaticFilesLoader({
prefix: 'languages/',
suffix: '.json'
});
$translateProvider.registerAvailableLanguageKeys(
['es', 'en'],
{
'en*': 'en',
'es*': 'es',
'*': 'en' // must be last!
}
);
$translateProvider.fallbackLanguage(['en']);
jQuery.ajax({ url: urlApi + 'userSettings/keyUiLocale/', contentType: 'text/plain', method: 'GET', dataType: 'text', async: false}).success(function (uiLocale) {
if (uiLocale == ''){
$translateProvider.determinePreferredLanguage();
}
else{
$translateProvider.use(uiLocale);
}
}).fail(function () {
$translateProvider.determinePreferredLanguage();
});
});