Browse Source

translated all texts

tags/v0.1.0
Robin Thoni 8 years ago
parent
commit
58edbb8988

+ 2
- 0
TODO View File

1
+loaders (lu busy?)
2
+

+ 50
- 28
app/app.js View File

9
     'ngMaterial',
9
     'ngMaterial',
10
     'md.data.table',
10
     'md.data.table',
11
     'sasrio.angular-material-sidenav',
11
     'sasrio.angular-material-sidenav',
12
+    'pascalprecht.translate',
12
     'luticate2Utils',
13
     'luticate2Utils',
13
     // 'luticateAuth',
14
     // 'luticateAuth',
14
     'appSdk'
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
             // $mdThemingProvider
20
             // $mdThemingProvider
20
             //     .theme('default')
21
             //     .theme('default')
26
             //     .primaryPalette('blue')
27
             //     .primaryPalette('blue')
27
             //     .accentPalette('pink');
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
             $mdIconProvider
38
             $mdIconProvider
30
                 .icon('md-toggle-arrow', 'img/arrow.svg');
39
                 .icon('md-toggle-arrow', 'img/arrow.svg');
31
 
40
 
32
             ssSideNavSectionsProvider.initWithTheme($mdThemingProvider);
41
             ssSideNavSectionsProvider.initWithTheme($mdThemingProvider);
33
             ssSideNavSectionsProvider.initWithSections([{
42
             ssSideNavSectionsProvider.initWithSections([{
34
                 id: 'toogle_1',
43
                 id: 'toogle_1',
35
-                name: 'Home',
44
+                name: 'home.name',
36
                 type: 'heading',
45
                 type: 'heading',
37
                 children: [{
46
                 children: [{
38
-                    name: 'Home 1',
47
+                    name: 'home.name',
39
                     type: 'toggle',
48
                     type: 'toggle',
40
                     pages: [{
49
                     pages: [{
41
                         id: 'toogle_1_link_1',
50
                         id: 'toogle_1_link_1',
42
-                        name: 'Home 1 1',
51
+                        name: 'home.name',
43
                         state: 'home'
52
                         state: 'home'
44
                     }, {
53
                     }, {
45
                         id: 'toogle_1_link_2',
54
                         id: 'toogle_1_link_2',
48
                         hidden: true
57
                         hidden: true
49
                     }, {
58
                     }, {
50
                         id: 'toogle_1_link_3',
59
                         id: 'toogle_1_link_3',
51
-                        name: 'Home 1 3',
60
+                        name: 'home.name',
52
                         state: 'home.1.3'
61
                         state: 'home.1.3'
53
                     }]
62
                     }]
54
                 }]
63
                 }]
55
             }, {
64
             }, {
56
                 id: 'link_1',
65
                 id: 'link_1',
57
-                name: 'Home 2 ',
66
+                name: 'home.name',
58
                 state: 'home.2',
67
                 state: 'home.2',
59
                 type: 'link',
68
                 type: 'link',
60
                 icon: 'fa fa-check'
69
                 icon: 'fa fa-check'
61
             }, {
70
             }, {
62
                 id: 'link_2',
71
                 id: 'link_2',
63
-                name: 'Home 3',
72
+                name: 'home.name',
64
                 state: 'home.3',
73
                 state: 'home.3',
65
                 type: 'link'
74
                 type: 'link'
66
             }, {
75
             }, {
67
                 id: 'link_3',
76
                 id: 'link_3',
68
-                name: 'Link 3',
77
+                name: 'home.name',
69
                 state: 'common.link3',
78
                 state: 'common.link3',
70
                 type: 'link',
79
                 type: 'link',
71
                 hidden: true
80
                 hidden: true
72
             },  {
81
             },  {
73
                 id: 'toogle_2',
82
                 id: 'toogle_2',
74
-                name: 'PkGuid',
83
+                name: 'pkguid.name',
75
                 type: 'heading',
84
                 type: 'heading',
76
                 children: [{
85
                 children: [{
77
-                    name: 'PkGuids',
86
+                    name: 'pkguid.name',
78
                     type: 'toggle',
87
                     type: 'toggle',
79
                     pages: [{
88
                     pages: [{
80
                         id: 'toogle_2_link_1',
89
                         id: 'toogle_2_link_1',
81
-                        name: 'All',
90
+                        name: 'common.all',
82
                         state: 'pkguid'
91
                         state: 'pkguid'
83
                     },{
92
                     },{
84
                         id: 'toogle_2_link_1',
93
                         id: 'toogle_2_link_1',
85
-                        name: 'New',
94
+                        name: 'common.new',
86
                         state: 'pkguid_add'
95
                         state: 'pkguid_add'
87
                     }]
96
                     }]
88
                 }]
97
                 }]
100
             $stateProvider.state('home', {
109
             $stateProvider.state('home', {
101
                 url:'/',
110
                 url:'/',
102
                 parent: 'root',
111
                 parent: 'root',
103
-                title: "Home",
112
+                title: "home.name",
104
                 reloadOnSearch: false,
113
                 reloadOnSearch: false,
105
                 templateUrl:'views/home.html',
114
                 templateUrl:'views/home.html',
106
                 controller:'HomeController'
115
                 controller:'HomeController'
109
             $stateProvider.state('pkguid', {
118
             $stateProvider.state('pkguid', {
110
                 url:'/pkguids',
119
                 url:'/pkguids',
111
                 parent: 'root',
120
                 parent: 'root',
112
-                title: "PkGuid",
121
+                title: "pkguid.name",
113
                 reloadOnSearch: false,
122
                 reloadOnSearch: false,
114
                 templateUrl:'views/pkguid.html',
123
                 templateUrl:'views/pkguid.html',
115
                 controller:'PkGuidController'
124
                 controller:'PkGuidController'
118
             $stateProvider.state('pkguid_add', {
127
             $stateProvider.state('pkguid_add', {
119
                 url:'/pkguids/add',
128
                 url:'/pkguids/add',
120
                 parent: 'root',
129
                 parent: 'root',
121
-                title: "New PkGuid",
122
-                toolbarTitle: "PkGuid ~ New",
130
+                title: "pkguid.add.defaultTitle",
131
+                toolbarTitle: "pkguid.add.defaultToolbarTitle",
123
                 reloadOnSearch: false,
132
                 reloadOnSearch: false,
124
                 templateUrl:'views/pkguidedit.html',
133
                 templateUrl:'views/pkguidedit.html',
125
                 controller:'PkGuidEditController'
134
                 controller:'PkGuidEditController'
128
             $stateProvider.state('pkguid_edit', {
137
             $stateProvider.state('pkguid_edit', {
129
                 url:'/pkguids/edit/:id',
138
                 url:'/pkguids/edit/:id',
130
                 parent: 'root',
139
                 parent: 'root',
131
-                title: "Edit PkGuid",
132
-                toolbarTitle: "PkGuid ~ Edit",
140
+                title: "pkguid.edit.defaultTitle",
141
+                toolbarTitle: "pkguid.edit.defaultToolbarTitle",
133
                 reloadOnSearch: false,
142
                 reloadOnSearch: false,
134
                 templateUrl:'views/pkguidedit.html',
143
                 templateUrl:'views/pkguidedit.html',
135
                 controller:'PkGuidEditController',
144
                 controller:'PkGuidEditController',
140
 
149
 
141
             $urlRouterProvider.otherwise('/');
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
         $transitions.onEnter({}, function($transitions)
173
         $transitions.onEnter({}, function($transitions)
152
         {
174
         {
153
             var toState = $transitions.$to();
175
             var toState = $transitions.$to();
154
             var title = toState.title != null ? toState.title : toState.toolbarTitle != null ? toState.toolbarTitle : null;
176
             var title = toState.title != null ? toState.title : toState.toolbarTitle != null ? toState.toolbarTitle : null;
155
             var toolbarTitle = toState.toolbarTitle != null ? toState.toolbarTitle : toState.title != null ? toState.title : null;
177
             var toolbarTitle = toState.toolbarTitle != null ? toState.toolbarTitle : toState.title != null ? toState.title : null;
156
             if (title != null) {
178
             if (title != null) {
157
-                AppUtilsBusiness.setTitle(title);
179
+                AppUtilsBusiness.setTitle(AppUtilsBusiness.tr(title));
158
             }
180
             }
159
             if (toolbarTitle != null) {
181
             if (toolbarTitle != null) {
160
-                AppUtilsBusiness.setToolbarTitle(toolbarTitle);
182
+                AppUtilsBusiness.setToolbarTitle(AppUtilsBusiness.tr(toolbarTitle));
161
             }
183
             }
162
         });
184
         });
163
     }]);
185
     }]);

+ 8
- 8
app/controllers/pkguid.controller.js View File

27
 
27
 
28
             $scope.askRemoveOne = function (pkguid) {
28
             $scope.askRemoveOne = function (pkguid) {
29
                 var confirm = $mdDialog.confirm()
29
                 var confirm = $mdDialog.confirm()
30
-                    .title('Confirm deletion')
31
-                    .textContent('Do you really want to delete PkGuid \'' + pkguid.someText + '\'?')
32
-                    .ok('Delete')
33
-                    .cancel('Cancel');
30
+                    .title(AppUtilsBusiness.tr('common.confirmDelete'))
31
+                    .textContent(AppUtilsBusiness.tr('pkguid.deleteOne', {text: pkguid.someText}))
32
+                    .ok(AppUtilsBusiness.tr('common.delete'))
33
+                    .cancel(AppUtilsBusiness.tr('common.cancel'));
34
                 $mdDialog.show(confirm).then(function() {
34
                 $mdDialog.show(confirm).then(function() {
35
                     $scope.error = null;
35
                     $scope.error = null;
36
                     $scope.promise = pkGuidBusiness.deleteDbo(pkguid.id).then(function(data)
36
                     $scope.promise = pkGuidBusiness.deleteDbo(pkguid.id).then(function(data)
45
 
45
 
46
             $scope.askRemoveSelected = function () {
46
             $scope.askRemoveSelected = function () {
47
                 var confirm = $mdDialog.confirm()
47
                 var confirm = $mdDialog.confirm()
48
-                    .title('Confirm deletion')
49
-                    .textContent('Do you really want to delete ' + $scope.selected.length + ' PkGuid?')
50
-                    .ok('Delete')
51
-                    .cancel('Cancel');
48
+                    .title(AppUtilsBusiness.tr('common.confirmDelete'))
49
+                    .textContent(AppUtilsBusiness.tr('pkguid.deleteMultiple', {count: $scope.selected.length}))
50
+                    .ok(AppUtilsBusiness.tr('common.delete'))
51
+                    .cancel(AppUtilsBusiness.tr('common.cancel'));
52
                 $mdDialog.show(confirm).then(function() {
52
                 $mdDialog.show(confirm).then(function() {
53
                     $scope.error = null;
53
                     $scope.error = null;
54
                     $scope.removeFirstSelected();
54
                     $scope.removeFirstSelected();

+ 2
- 2
app/controllers/pkguidedit.controller.js View File

16
             $scope.setTitle = function()
16
             $scope.setTitle = function()
17
             {
17
             {
18
                 if ($scope.pkguid.id != null) {
18
                 if ($scope.pkguid.id != null) {
19
-                    AppUtilsBusiness.setTitle('Edit PkGuid \'' + $scope.pkguid.someText + '\'');
20
-                    AppUtilsBusiness.setToolbarTitle('PkGuid ~ Edit ~ \'' + $scope.pkguid.someText + '\'');
19
+                    AppUtilsBusiness.setTitle(AppUtilsBusiness.tr('pkguid.edit.title', {text: $scope.pkguid.someText}));
20
+                    AppUtilsBusiness.setToolbarTitle(AppUtilsBusiness.tr('pkguid.edit.toolbarTitle', {text: $scope.pkguid.someText}));
21
                 }
21
                 }
22
             };
22
             };
23
 
23
 

+ 1
- 1
app/controllers/toolbar.controller.js View File

6
     .controller('ToolBarController', ['$scope', '$rootScope', '$mdSidenav',
6
     .controller('ToolBarController', ['$scope', '$rootScope', '$mdSidenav',
7
         function ($scope, $rootScope, $mdSidenav) {
7
         function ($scope, $rootScope, $mdSidenav) {
8
 
8
 
9
-            $scope.title = "Toolbar";
9
+            $scope.title = '';
10
 
10
 
11
             $scope.toggleSideBar = function () {
11
             $scope.toggleSideBar = function () {
12
                 $mdSidenav('left').toggle();
12
                 $mdSidenav('left').toggle();

+ 5
- 1
app/index.html View File

3
 <head>
3
 <head>
4
     <base href="/app/">
4
     <base href="/app/">
5
     <meta charset="utf-8">
5
     <meta charset="utf-8">
6
-    <title ng-bind="title">MyApp</title>
6
+    <title ng-bind="title">Loading...</title>
7
 
7
 
8
     <!-- build:css css/globals.css -->
8
     <!-- build:css css/globals.css -->
9
     <link rel="stylesheet" href="../bower_components/components-font-awesome/css/font-awesome.min.css"/>
9
     <link rel="stylesheet" href="../bower_components/components-font-awesome/css/font-awesome.min.css"/>
40
     <script src="../bower_components/luticate2-utils/dist/luticate-utils.min.js"></script>
40
     <script src="../bower_components/luticate2-utils/dist/luticate-utils.min.js"></script>
41
     <script src="../bower_components/angular-material-data-table/dist/md-data-table.min.js"></script>
41
     <script src="../bower_components/angular-material-data-table/dist/md-data-table.min.js"></script>
42
     <script src="../bower_components/angular-material-sidenav/angular-material-sidenav.js"></script>
42
     <script src="../bower_components/angular-material-sidenav/angular-material-sidenav.js"></script>
43
+    <script src="../bower_components/angular-translate/angular-translate.min.js"></script>
44
+    <script src="../bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
45
+    <script src="../bower_components/messageformat/messageformat.js"></script>
46
+    <script src="../bower_components/angular-translate-interpolation-messageformat/angular-translate-interpolation-messageformat.min.js"></script>
43
     <!--<script src="../bower_components/luticate-auth/dist/luticate-auth.min.js"></script>-->
47
     <!--<script src="../bower_components/luticate-auth/dist/luticate-auth.min.js"></script>-->
44
     <!--<script src="../bower_components/angular-dialog-service/dist/dialogs.js"></script>-->
48
     <!--<script src="../bower_components/angular-dialog-service/dist/dialogs.js"></script>-->
45
     <!--<script src="../bower_components/angular-sanitize/angular-sanitize.js"></script>-->
49
     <!--<script src="../bower_components/angular-sanitize/angular-sanitize.js"></script>-->

+ 49
- 0
app/translations/en.json View File

1
+{
2
+  "common": {
3
+    "appName": "MyApp",
4
+    "filter": "Filter",
5
+    "all": "All",
6
+    "new": "New",
7
+    "refresh": "Refresh",
8
+    "close": "Close",
9
+    "actions": "Actions",
10
+    "never": "Never",
11
+    "delete": "Delete",
12
+    "edit": "Edit",
13
+    "submit": "Submit",
14
+    "menu": "Menu",
15
+    "cancel": "Cancel",
16
+    "confirmDelete": "Confirm deletion",
17
+    "pagination": {
18
+      "of": "of",
19
+      "page": "Page:",
20
+      "rowsPerPage": "Items per page:"
21
+    },
22
+    "createdBy": "Created with ❤ by"
23
+  },
24
+  "home": {
25
+    "name": "Home",
26
+    "welcome": "Welcome Home!"
27
+  },
28
+  "pkguid": {
29
+    "name": "PkGuids",
30
+    "selectedItems": "{count} {count, select, 1{PkGuid} other{PkGuids}} selected",
31
+    "id": "Id",
32
+    "someText": "Some Text",
33
+    "someInt": "Some Int",
34
+    "createdAt": "Created At",
35
+    "updatedAt": "Updated At",
36
+    "deleteOne": "Do you really want to delete PkGuid '{text}'?",
37
+    "deleteMultiple": "Do you really want to delete {count} {count, select, 1{PkGuid} other{PkGuids}}?",
38
+    "edit": {
39
+      "defaultTitle": "Edit PkGuid",
40
+      "defaultToolbarTitle": "PkGuid ~ Edit",
41
+      "title": "Edit PkGuid '{text}'",
42
+      "toolbarTitle": "PkGuid ~ Edit ~ {text}"
43
+    },
44
+    "add": {
45
+      "defaultTitle": "New PkGuid",
46
+      "defaultToolbarTitle": "PkGuid ~ New"
47
+    }
48
+  }
49
+}

+ 1
- 1
app/views/footer.html View File

4
     <div layout="column" layout-fill layout-align="top center">
4
     <div layout="column" layout-fill layout-align="top center">
5
         <div flex>
5
         <div flex>
6
             <div class="col-lg-12">
6
             <div class="col-lg-12">
7
-                <p>Copyright &copy; <a href="https://www.rthoni.com/">Robin Thoni</a> <span date-now="yyyy"></span></p>
7
+                <p>{{ 'common.createdBy' | translate }} <a href="https://www.rthoni.com/">Robin Thoni</a></p>
8
             </div>
8
             </div>
9
         </div>
9
         </div>
10
     </div>
10
     </div>

+ 1
- 1
app/views/home.html View File

1
 <div layout="column" layout-fill layout-align="top">
1
 <div layout="column" layout-fill layout-align="top">
2
-    <p>Welcome Home</p>
2
+    <p>{{ 'home.welcome' | translate }}</p>
3
 </div>
3
 </div>

+ 19
- 17
app/views/pkguid.html View File

3
     <div flex>
3
     <div flex>
4
         <md-toolbar class="md-table-toolbar md-default" ng-show="!isFilterShown && selected.length == 0">
4
         <md-toolbar class="md-table-toolbar md-default" ng-show="!isFilterShown && selected.length == 0">
5
             <div class="md-toolbar-tools">
5
             <div class="md-toolbar-tools">
6
-                <span>PkGuids</span>
6
+                <span>{{ 'pkguid.name' | translate }}</span>
7
                 <span flex></span>
7
                 <span flex></span>
8
-                <md-button class="md-icon-button" ng-click="showFilter(true)">
8
+                <md-button class="md-icon-button" ng-click="showFilter(true)" title="{{ 'common.filter' | translate }}">
9
                     <md-icon class="material-icons">filter_list</md-icon>
9
                     <md-icon class="material-icons">filter_list</md-icon>
10
                 </md-button>
10
                 </md-button>
11
-                <md-button class="md-icon-button" ui-sref="pkguid_add">
11
+                <md-button class="md-icon-button" ui-sref="pkguid_add" title="{{ 'common.new' | translate }}">
12
                     <md-icon class="material-icons">add</md-icon>
12
                     <md-icon class="material-icons">add</md-icon>
13
                 </md-button>
13
                 </md-button>
14
-                <md-button class="md-icon-button" ng-click="getPkGuids()">
14
+                <md-button class="md-icon-button" ng-click="getPkGuids()" title="{{ 'common.refresh' | translate }}">
15
                     <md-icon class="material-icons">refresh</md-icon>
15
                     <md-icon class="material-icons">refresh</md-icon>
16
                 </md-button>
16
                 </md-button>
17
             </div>
17
             </div>
21
                 <md-icon class="material-icons">search</md-icon>
21
                 <md-icon class="material-icons">search</md-icon>
22
                 <form autocomplete="off">
22
                 <form autocomplete="off">
23
                     <md-input-container class="md-block" flex-gt-sm>
23
                     <md-input-container class="md-block" flex-gt-sm>
24
-                        <label>Filter</label>
24
+                        <label>{{ 'common.filter' | translate }}</label>
25
                         <input type="text" ng-model="query.filter" ng-model-options="{debounce: 500}" ng-change="getPkGuids()">
25
                         <input type="text" ng-model="query.filter" ng-model-options="{debounce: 500}" ng-change="getPkGuids()">
26
                     </md-input-container>
26
                     </md-input-container>
27
 
27
 
28
                 </form>
28
                 </form>
29
-                <md-button class="md-icon-button" ng-click="showFilter(false)">
29
+                <md-button class="md-icon-button" ng-click="showFilter(false)" title="{{ 'common.close' | translate }}">
30
                     <md-icon class="material-icons">close</md-icon>
30
                     <md-icon class="material-icons">close</md-icon>
31
                 </md-button>
31
                 </md-button>
32
             </div>
32
             </div>
33
         </md-toolbar>
33
         </md-toolbar>
34
         <md-toolbar class="md-table-toolbar alternate" ng-show="selected.length > 0">
34
         <md-toolbar class="md-table-toolbar alternate" ng-show="selected.length > 0">
35
             <div class="md-toolbar-tools">
35
             <div class="md-toolbar-tools">
36
-                <span>{{selected.length}} {{selected.length > 1 ? 'PkGuids' : 'PkGuid'}} selected</span>
36
+                <span>{{ 'pkguid.selectedItems' | translate:{count:selected.length} }}</span>
37
                 <span flex></span>
37
                 <span flex></span>
38
                 <md-button class="md-icon-button" ng-click="askRemoveSelected()">
38
                 <md-button class="md-icon-button" ng-click="askRemoveSelected()">
39
                     <md-icon class="material-icons">delete</md-icon>
39
                     <md-icon class="material-icons">delete</md-icon>
47
             <table md-table md-row-select multiple ng-model="selected" md-progress="promise">
47
             <table md-table md-row-select multiple ng-model="selected" md-progress="promise">
48
                 <thead md-head md-order="query.order" md-on-reorder="getPkGuids">
48
                 <thead md-head md-order="query.order" md-on-reorder="getPkGuids">
49
                 <tr md-row>
49
                 <tr md-row>
50
-                    <th md-column md-order-by="id"><span>Id</span></th>
51
-                    <th md-column md-order-by="someText"><span>Some Text</span></th>
52
-                    <th md-column md-order-by="someInt" md-numeric>Some Int</th>
53
-                    <th md-column md-order-by="createdAt">Created At</th>
54
-                    <th md-column md-order-by="updatedAt">Updated At</th>
55
-                    <th md-column>Actions</th>
50
+                    <th md-column md-order-by="id"><span>{{ 'pkguid.id' | translate }}</span></th>
51
+                    <th md-column md-order-by="someText"><span>{{ 'pkguid.someText' | translate }}</span></th>
52
+                    <th md-column md-order-by="someInt" md-numeric>{{ 'pkguid.someInt' | translate }}</th>
53
+                    <th md-column md-order-by="createdAt">{{ 'pkguid.createdAt' | translate }}</th>
54
+                    <th md-column md-order-by="updatedAt">{{ 'pkguid.updatedAt' | translate }}</th>
55
+                    <th md-column>{{ 'common.actions' | translate }}</th>
56
                 </tr>
56
                 </tr>
57
                 </thead>
57
                 </thead>
58
                 <tbody md-body>
58
                 <tbody md-body>
61
                     <td md-cell>{{item.someText}}</td>
61
                     <td md-cell>{{item.someText}}</td>
62
                     <td md-cell>{{item.someInt}}</td>
62
                     <td md-cell>{{item.someInt}}</td>
63
                     <td md-cell>{{item.createdAt | date : 'medium'}}</td>
63
                     <td md-cell>{{item.createdAt | date : 'medium'}}</td>
64
-                    <td md-cell>{{item.updatedAt == null ? 'Never' : item.updatedAt | date : 'medium'}}</td>
64
+                    <td md-cell>{{item.updatedAt == null ? ('common.never' | translate ) : (item.updatedAt | date : 'medium')}}</td>
65
                     <td md-cell>
65
                     <td md-cell>
66
-                        <md-button class="md-icon-button" ui-sref="pkguid_edit({id: item.id, pkguid: item})">
66
+                        <md-button class="md-icon-button" ui-sref="pkguid_edit({id: item.id, pkguid: item})" title="{{ 'common.edit' | translate }}">
67
                             <md-icon class="material-icons">mode_edit</md-icon>
67
                             <md-icon class="material-icons">mode_edit</md-icon>
68
                         </md-button>
68
                         </md-button>
69
-                        <md-button class="md-icon-button" ng-click="askRemoveOne(item)">
69
+                        <md-button class="md-icon-button" ng-click="askRemoveOne(item)" title="{{ 'common.delete' | translate }}">
70
                             <md-icon class="material-icons">delete</md-icon>
70
                             <md-icon class="material-icons">delete</md-icon>
71
                         </md-button>
71
                         </md-button>
72
                     </td>
72
                     </td>
76
         </md-table-container>
76
         </md-table-container>
77
     </div>
77
     </div>
78
 
78
 
79
-    <md-table-pagination class="col-xs-11" md-limit="query.limit" md-limit-options="[1, 5, 10, 15]" md-page="query.page" md-total="{{pkGuids.count}}" md-on-paginate="getPkGuids" md-page-select></md-table-pagination>
79
+    <md-table-pagination md-label="{of: '{{ 'common.pagination.of' | translate }}', page: '{{ 'common.pagination.page' | translate }}', rowsPerPage: '{{ 'common.pagination.rowsPerPage' | translate }}'}"
80
+                         class="col-xs-11" md-limit="query.limit" md-limit-options="[5, 10, 15]"
81
+                         md-page="query.page" md-total="{{pkGuids.count}}" md-on-paginate="getPkGuids" md-page-select></md-table-pagination>
80
 
82
 
81
     <div class="isa_error" ng-show="error != null">
83
     <div class="isa_error" ng-show="error != null">
82
         <i class="fa fa-times-circle"></i>
84
         <i class="fa fa-times-circle"></i>

+ 3
- 3
app/views/pkguidedit.html View File

3
         <form name="editForm">
3
         <form name="editForm">
4
             <div layout-gt-sm="row">
4
             <div layout-gt-sm="row">
5
                 <md-input-container class="md-block" flex-gt-sm>
5
                 <md-input-container class="md-block" flex-gt-sm>
6
-                    <label>SomeText</label>
6
+                    <label>{{ 'pkguid.someText' | translate }}</label>
7
                     <input required ng-model="pkguid.someText">
7
                     <input required ng-model="pkguid.someText">
8
                 </md-input-container>
8
                 </md-input-container>
9
 
9
 
10
                 <md-input-container class="md-block" flex-gt-sm>
10
                 <md-input-container class="md-block" flex-gt-sm>
11
-                    <label>Some Int</label>
11
+                    <label>{{ 'pkguid.someInt' | translate }}</label>
12
                     <input required type="number" ng-model="pkguid.someInt">
12
                     <input required type="number" ng-model="pkguid.someInt">
13
                 </md-input-container>
13
                 </md-input-container>
14
             </div>
14
             </div>
16
                 <md-progress-linear ng-disabled="!running" md-mode="indeterminate"></md-progress-linear>
16
                 <md-progress-linear ng-disabled="!running" md-mode="indeterminate"></md-progress-linear>
17
             </div>
17
             </div>
18
             <div>
18
             <div>
19
-                <md-button type="submit" ng-click="!editForm.$invalid && submit()">Submit</md-button>
19
+                <md-button type="submit" ng-click="!editForm.$invalid && submit()">{{ 'common.submit' | translate }}</md-button>
20
             </div>
20
             </div>
21
             <div class="isa_error" ng-show="error != null">
21
             <div class="isa_error" ng-show="error != null">
22
                 <i class="fa fa-times-circle"></i>
22
                 <i class="fa fa-times-circle"></i>

+ 1
- 1
app/views/sidebar.html View File

1
 <md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')">
1
 <md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')">
2
     <header class="nav-header" ss-style-color="{'background-color': 'primary.default'}">
2
     <header class="nav-header" ss-style-color="{'background-color': 'primary.default'}">
3
         <md-toolbar class="md-theme-indigo">
3
         <md-toolbar class="md-theme-indigo">
4
-            <h1 class="md-toolbar-tools"><a ui-sref="home">MyApp</a></h1>
4
+            <h1 class="md-toolbar-tools"><a ui-sref="home">{{ 'common.appName' | translate }}</a></h1>
5
         </md-toolbar>
5
         </md-toolbar>
6
     </header>
6
     </header>
7
     <div flex ng-controller="SideBarController">
7
     <div flex ng-controller="SideBarController">

+ 1
- 1
app/views/toolbar.html View File

1
 <md-toolbar layout="row" ng-controller="ToolBarController">
1
 <md-toolbar layout="row" ng-controller="ToolBarController">
2
     <div class="md-toolbar-tools">
2
     <div class="md-toolbar-tools">
3
-        <md-button class="md-icon-button" aria-label="Toolbar" ng-click="toggleSideBar()" hide-gt-md>
3
+        <md-button class="md-icon-button" aria-label="Toolbar" ng-click="toggleSideBar()" hide-gt-md title="{{ 'common.menu' | translate }}">
4
             <md-icon class="material-icons">menu</md-icon>
4
             <md-icon class="material-icons">menu</md-icon>
5
         </md-button>
5
         </md-button>
6
         <h2>{{title}}</h2>
6
         <h2>{{title}}</h2>

+ 3
- 1
bower.json View File

17
     "components-font-awesome": "^4.7.0",
17
     "components-font-awesome": "^4.7.0",
18
     "angular-material-sidenav": "^0.0.14",
18
     "angular-material-sidenav": "^0.0.14",
19
     "material-design-icons": "^3.0.1",
19
     "material-design-icons": "^3.0.1",
20
-    "angular-translate": "^2.13.1"
20
+    "angular-translate": "^2.13.1",
21
+    "angular-translate-loader-static-files": "^2.13.1",
22
+    "angular-translate-interpolation-messageformat": "^2.13.1"
21
   }
23
   }
22
 }
24
 }

+ 7
- 2
sdk/Business/apputils.business.js View File

6
     'use strict';
6
     'use strict';
7
 
7
 
8
     angular.module('appSdk')
8
     angular.module('appSdk')
9
-        .factory('AppUtilsBusiness', ['$rootScope', function($rootScope) {
9
+        .factory('AppUtilsBusiness', ['$rootScope', '$translate', function($rootScope, $translate) {
10
 
10
 
11
             var AppUtilsBusiness = {};
11
             var AppUtilsBusiness = {};
12
 
12
 
23
 
23
 
24
             AppUtilsBusiness.setTitle = function(title)
24
             AppUtilsBusiness.setTitle = function(title)
25
             {
25
             {
26
-                $rootScope.title = title + ' - MyApp';
26
+                $rootScope.title = title + ' - ' + AppUtilsBusiness.tr('app.name');
27
             };
27
             };
28
 
28
 
29
             AppUtilsBusiness.setToolbarTitle = function(title)
29
             AppUtilsBusiness.setToolbarTitle = function(title)
31
                 $rootScope.$emit('toolbar.title', {title: title});
31
                 $rootScope.$emit('toolbar.title', {title: title});
32
             };
32
             };
33
 
33
 
34
+            AppUtilsBusiness.tr = function(id, data)
35
+            {
36
+                return $translate.instant(id, data);
37
+            };
38
+
34
             return AppUtilsBusiness;
39
             return AppUtilsBusiness;
35
         }]);
40
         }]);
36
 })();
41
 })();

Loading…
Cancel
Save