|
|
@@ -9,12 +9,13 @@ angular.module('app', [
|
|
9
|
9
|
'ngMaterial',
|
|
10
|
10
|
'md.data.table',
|
|
11
|
11
|
'sasrio.angular-material-sidenav',
|
|
|
12
|
+ 'pascalprecht.translate',
|
|
12
|
13
|
'luticate2Utils',
|
|
13
|
14
|
// 'luticateAuth',
|
|
14
|
15
|
'appSdk'
|
|
15
|
16
|
])
|
|
16
|
|
- .config(['$stateProvider', '$urlRouterProvider', 'ssSideNavSectionsProvider', '$mdThemingProvider', '$mdIconProvider',
|
|
17
|
|
- function($stateProvider, $urlRouterProvider, ssSideNavSectionsProvider, $mdThemingProvider, $mdIconProvider) {
|
|
|
17
|
+ .config(['$stateProvider', '$urlRouterProvider', 'ssSideNavSectionsProvider', '$mdThemingProvider', '$mdIconProvider', '$translateProvider',
|
|
|
18
|
+ function($stateProvider, $urlRouterProvider, ssSideNavSectionsProvider, $mdThemingProvider, $mdIconProvider, $translateProvider) {
|
|
18
|
19
|
|
|
19
|
20
|
// $mdThemingProvider
|
|
20
|
21
|
// .theme('default')
|
|
|
@@ -26,20 +27,28 @@ angular.module('app', [
|
|
26
|
27
|
// .primaryPalette('blue')
|
|
27
|
28
|
// .accentPalette('pink');
|
|
28
|
29
|
|
|
|
30
|
+ $translateProvider.useSanitizeValueStrategy('escape');
|
|
|
31
|
+ $translateProvider.useMessageFormatInterpolation();
|
|
|
32
|
+ $translateProvider.useStaticFilesLoader({
|
|
|
33
|
+ prefix: 'translations/',
|
|
|
34
|
+ suffix: '.json'
|
|
|
35
|
+ });
|
|
|
36
|
+ $translateProvider.preferredLanguage('en');
|
|
|
37
|
+
|
|
29
|
38
|
$mdIconProvider
|
|
30
|
39
|
.icon('md-toggle-arrow', 'img/arrow.svg');
|
|
31
|
40
|
|
|
32
|
41
|
ssSideNavSectionsProvider.initWithTheme($mdThemingProvider);
|
|
33
|
42
|
ssSideNavSectionsProvider.initWithSections([{
|
|
34
|
43
|
id: 'toogle_1',
|
|
35
|
|
- name: 'Home',
|
|
|
44
|
+ name: 'home.name',
|
|
36
|
45
|
type: 'heading',
|
|
37
|
46
|
children: [{
|
|
38
|
|
- name: 'Home 1',
|
|
|
47
|
+ name: 'home.name',
|
|
39
|
48
|
type: 'toggle',
|
|
40
|
49
|
pages: [{
|
|
41
|
50
|
id: 'toogle_1_link_1',
|
|
42
|
|
- name: 'Home 1 1',
|
|
|
51
|
+ name: 'home.name',
|
|
43
|
52
|
state: 'home'
|
|
44
|
53
|
}, {
|
|
45
|
54
|
id: 'toogle_1_link_2',
|
|
|
@@ -48,41 +57,41 @@ angular.module('app', [
|
|
48
|
57
|
hidden: true
|
|
49
|
58
|
}, {
|
|
50
|
59
|
id: 'toogle_1_link_3',
|
|
51
|
|
- name: 'Home 1 3',
|
|
|
60
|
+ name: 'home.name',
|
|
52
|
61
|
state: 'home.1.3'
|
|
53
|
62
|
}]
|
|
54
|
63
|
}]
|
|
55
|
64
|
}, {
|
|
56
|
65
|
id: 'link_1',
|
|
57
|
|
- name: 'Home 2 ',
|
|
|
66
|
+ name: 'home.name',
|
|
58
|
67
|
state: 'home.2',
|
|
59
|
68
|
type: 'link',
|
|
60
|
69
|
icon: 'fa fa-check'
|
|
61
|
70
|
}, {
|
|
62
|
71
|
id: 'link_2',
|
|
63
|
|
- name: 'Home 3',
|
|
|
72
|
+ name: 'home.name',
|
|
64
|
73
|
state: 'home.3',
|
|
65
|
74
|
type: 'link'
|
|
66
|
75
|
}, {
|
|
67
|
76
|
id: 'link_3',
|
|
68
|
|
- name: 'Link 3',
|
|
|
77
|
+ name: 'home.name',
|
|
69
|
78
|
state: 'common.link3',
|
|
70
|
79
|
type: 'link',
|
|
71
|
80
|
hidden: true
|
|
72
|
81
|
}, {
|
|
73
|
82
|
id: 'toogle_2',
|
|
74
|
|
- name: 'PkGuid',
|
|
|
83
|
+ name: 'pkguid.name',
|
|
75
|
84
|
type: 'heading',
|
|
76
|
85
|
children: [{
|
|
77
|
|
- name: 'PkGuids',
|
|
|
86
|
+ name: 'pkguid.name',
|
|
78
|
87
|
type: 'toggle',
|
|
79
|
88
|
pages: [{
|
|
80
|
89
|
id: 'toogle_2_link_1',
|
|
81
|
|
- name: 'All',
|
|
|
90
|
+ name: 'common.all',
|
|
82
|
91
|
state: 'pkguid'
|
|
83
|
92
|
},{
|
|
84
|
93
|
id: 'toogle_2_link_1',
|
|
85
|
|
- name: 'New',
|
|
|
94
|
+ name: 'common.new',
|
|
86
|
95
|
state: 'pkguid_add'
|
|
87
|
96
|
}]
|
|
88
|
97
|
}]
|
|
|
@@ -100,7 +109,7 @@ angular.module('app', [
|
|
100
|
109
|
$stateProvider.state('home', {
|
|
101
|
110
|
url:'/',
|
|
102
|
111
|
parent: 'root',
|
|
103
|
|
- title: "Home",
|
|
|
112
|
+ title: "home.name",
|
|
104
|
113
|
reloadOnSearch: false,
|
|
105
|
114
|
templateUrl:'views/home.html',
|
|
106
|
115
|
controller:'HomeController'
|
|
|
@@ -109,7 +118,7 @@ angular.module('app', [
|
|
109
|
118
|
$stateProvider.state('pkguid', {
|
|
110
|
119
|
url:'/pkguids',
|
|
111
|
120
|
parent: 'root',
|
|
112
|
|
- title: "PkGuid",
|
|
|
121
|
+ title: "pkguid.name",
|
|
113
|
122
|
reloadOnSearch: false,
|
|
114
|
123
|
templateUrl:'views/pkguid.html',
|
|
115
|
124
|
controller:'PkGuidController'
|
|
|
@@ -118,8 +127,8 @@ angular.module('app', [
|
|
118
|
127
|
$stateProvider.state('pkguid_add', {
|
|
119
|
128
|
url:'/pkguids/add',
|
|
120
|
129
|
parent: 'root',
|
|
121
|
|
- title: "New PkGuid",
|
|
122
|
|
- toolbarTitle: "PkGuid ~ New",
|
|
|
130
|
+ title: "pkguid.add.defaultTitle",
|
|
|
131
|
+ toolbarTitle: "pkguid.add.defaultToolbarTitle",
|
|
123
|
132
|
reloadOnSearch: false,
|
|
124
|
133
|
templateUrl:'views/pkguidedit.html',
|
|
125
|
134
|
controller:'PkGuidEditController'
|
|
|
@@ -128,8 +137,8 @@ angular.module('app', [
|
|
128
|
137
|
$stateProvider.state('pkguid_edit', {
|
|
129
|
138
|
url:'/pkguids/edit/:id',
|
|
130
|
139
|
parent: 'root',
|
|
131
|
|
- title: "Edit PkGuid",
|
|
132
|
|
- toolbarTitle: "PkGuid ~ Edit",
|
|
|
140
|
+ title: "pkguid.edit.defaultTitle",
|
|
|
141
|
+ toolbarTitle: "pkguid.edit.defaultToolbarTitle",
|
|
133
|
142
|
reloadOnSearch: false,
|
|
134
|
143
|
templateUrl:'views/pkguidedit.html',
|
|
135
|
144
|
controller:'PkGuidEditController',
|
|
|
@@ -140,24 +149,37 @@ angular.module('app', [
|
|
140
|
149
|
|
|
141
|
150
|
$urlRouterProvider.otherwise('/');
|
|
142
|
151
|
}])
|
|
143
|
|
- .directive('dateNow', ['$filter', function($filter) {
|
|
144
|
|
- return {
|
|
145
|
|
- link: function( $scope, $element, $attrs) {
|
|
146
|
|
- $element.text($filter('date')(new Date(), $attrs.dateNow));
|
|
|
152
|
+ .run(['$rootScope', '$transitions', 'AppUtilsBusiness', 'ssSideNav', '$translate', function ($rootScope, $transitions, AppUtilsBusiness, ssSideNav, $translate) {
|
|
|
153
|
+ $translate('common.appName').then(function() {
|
|
|
154
|
+ for (var i = 0; i < ssSideNav.sections.length; ++i) {
|
|
|
155
|
+ var a = ssSideNav.sections[i];
|
|
|
156
|
+ a.name = AppUtilsBusiness.tr(a.name);
|
|
|
157
|
+ if (a.children != null) {
|
|
|
158
|
+ for (var j = 0; j < a.children.length; ++j) {
|
|
|
159
|
+ var b = a.children[j];
|
|
|
160
|
+ b.name = AppUtilsBusiness.tr(b.name);
|
|
|
161
|
+ if (b.pages != null) {
|
|
|
162
|
+ for (var k = 0; k < b.pages.length; ++k) {
|
|
|
163
|
+ var c = b.pages[k];
|
|
|
164
|
+ c.name = AppUtilsBusiness.tr(c.name);
|
|
|
165
|
+ }
|
|
|
166
|
+ }
|
|
|
167
|
+ }
|
|
|
168
|
+ }
|
|
147
|
169
|
}
|
|
148
|
|
- };
|
|
149
|
|
- }])
|
|
150
|
|
- .run(['$rootScope', '$transitions', 'AppUtilsBusiness', function ($rootScope, $transitions, AppUtilsBusiness) {
|
|
|
170
|
+ }, function (error) {
|
|
|
171
|
+ console.error(error);
|
|
|
172
|
+ });
|
|
151
|
173
|
$transitions.onEnter({}, function($transitions)
|
|
152
|
174
|
{
|
|
153
|
175
|
var toState = $transitions.$to();
|
|
154
|
176
|
var title = toState.title != null ? toState.title : toState.toolbarTitle != null ? toState.toolbarTitle : null;
|
|
155
|
177
|
var toolbarTitle = toState.toolbarTitle != null ? toState.toolbarTitle : toState.title != null ? toState.title : null;
|
|
156
|
178
|
if (title != null) {
|
|
157
|
|
- AppUtilsBusiness.setTitle(title);
|
|
|
179
|
+ AppUtilsBusiness.setTitle(AppUtilsBusiness.tr(title));
|
|
158
|
180
|
}
|
|
159
|
181
|
if (toolbarTitle != null) {
|
|
160
|
|
- AppUtilsBusiness.setToolbarTitle(toolbarTitle);
|
|
|
182
|
+ AppUtilsBusiness.setToolbarTitle(AppUtilsBusiness.tr(toolbarTitle));
|
|
161
|
183
|
}
|
|
162
|
184
|
});
|
|
163
|
185
|
}]);
|