forked from EyeSeeTea/projectmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
72 lines (60 loc) · 2.25 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
var appManagerMSF = angular.module("appManagerMSF", ['ngRoute','Dhis2Api','pascalprecht.translate','ui.bootstrap','d2Menu', 'angularFileUpload','angularTreeview']);
appManagerMSF.config(function($routeProvider) {
$routeProvider.when('/dataapproval', {
templateUrl: "modules/dataapproval/dataapprovalView.html",
controller: "dataapprovalController"
});
$routeProvider.when('/metadataimport', {
templateUrl: "modules/metadataimport/metadataimportView.html",
controller: "metadataimportController"
});
$routeProvider.when('/metadataexport', {
templateUrl: "modules/metadataexport/metadataexportView.html",
controller: "metadataexportController"
});
$routeProvider.when('/analytics', {
templateUrl: "modules/analytics/analyticsView.html",
controller: "analyticsController"
});
$routeProvider.when('/dataimport', {
templateUrl: "modules/dataimport/dataimportView.html",
controller: "dataimportController"
});
$routeProvider.when('/dataexport', {
templateUrl: "modules/dataexport/dataexportView.html",
controller: "dataexportController"
});
$routeProvider.when('/resetpasswd', {
templateUrl: "modules/resetpasswd/resetpasswdView.html",
controller: "resetpasswdController"
});
$routeProvider.otherwise({
redirectTo: '/'
});
});
appManagerMSF.config(function ($translateProvider, urlApi) {
$translateProvider.useStaticFilesLoader({
prefix: 'languages/',
suffix: '.json'
});
$translateProvider.registerAvailableLanguageKeys(
['es', 'fr', 'en'],
{
'en*': 'en',
'es*': 'es',
'fr*': 'fr',
'*': '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();
});
});