Browse Source

translated all texts

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

+ 2
- 0
TODO View File

@@ -0,0 +1,2 @@
1
+loaders (lu busy?)
2
+

+ 50
- 28
app/app.js View File

@@ -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
     }]);

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

@@ -27,10 +27,10 @@ angular.module('app')
27 27
 
28 28
             $scope.askRemoveOne = function (pkguid) {
29 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 34
                 $mdDialog.show(confirm).then(function() {
35 35
                     $scope.error = null;
36 36
                     $scope.promise = pkGuidBusiness.deleteDbo(pkguid.id).then(function(data)
@@ -45,10 +45,10 @@ angular.module('app')
45 45
 
46 46
             $scope.askRemoveSelected = function () {
47 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 52
                 $mdDialog.show(confirm).then(function() {
53 53
                     $scope.error = null;
54 54
                     $scope.removeFirstSelected();

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

@@ -16,8 +16,8 @@ angular.module('app')
16 16
             $scope.setTitle = function()
17 17
             {
18 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,7 +6,7 @@ angular.module('app')
6 6
     .controller('ToolBarController', ['$scope', '$rootScope', '$mdSidenav',
7 7
         function ($scope, $rootScope, $mdSidenav) {
8 8
 
9
-            $scope.title = "Toolbar";
9
+            $scope.title = '';
10 10
 
11 11
             $scope.toggleSideBar = function () {
12 12
                 $mdSidenav('left').toggle();

+ 5
- 1
app/index.html View File

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

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

@@ -0,0 +1,49 @@
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,7 +4,7 @@
4 4
     <div layout="column" layout-fill layout-align="top center">
5 5
         <div flex>
6 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 8
             </div>
9 9
         </div>
10 10
     </div>

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

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

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

@@ -3,15 +3,15 @@
3 3
     <div flex>
4 4
         <md-toolbar class="md-table-toolbar md-default" ng-show="!isFilterShown && selected.length == 0">
5 5
             <div class="md-toolbar-tools">
6
-                <span>PkGuids</span>
6
+                <span>{{ 'pkguid.name' | translate }}</span>
7 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 9
                     <md-icon class="material-icons">filter_list</md-icon>
10 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 12
                     <md-icon class="material-icons">add</md-icon>
13 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 15
                     <md-icon class="material-icons">refresh</md-icon>
16 16
                 </md-button>
17 17
             </div>
@@ -21,19 +21,19 @@
21 21
                 <md-icon class="material-icons">search</md-icon>
22 22
                 <form autocomplete="off">
23 23
                     <md-input-container class="md-block" flex-gt-sm>
24
-                        <label>Filter</label>
24
+                        <label>{{ 'common.filter' | translate }}</label>
25 25
                         <input type="text" ng-model="query.filter" ng-model-options="{debounce: 500}" ng-change="getPkGuids()">
26 26
                     </md-input-container>
27 27
 
28 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 30
                     <md-icon class="material-icons">close</md-icon>
31 31
                 </md-button>
32 32
             </div>
33 33
         </md-toolbar>
34 34
         <md-toolbar class="md-table-toolbar alternate" ng-show="selected.length > 0">
35 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 37
                 <span flex></span>
38 38
                 <md-button class="md-icon-button" ng-click="askRemoveSelected()">
39 39
                     <md-icon class="material-icons">delete</md-icon>
@@ -47,12 +47,12 @@
47 47
             <table md-table md-row-select multiple ng-model="selected" md-progress="promise">
48 48
                 <thead md-head md-order="query.order" md-on-reorder="getPkGuids">
49 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 56
                 </tr>
57 57
                 </thead>
58 58
                 <tbody md-body>
@@ -61,12 +61,12 @@
61 61
                     <td md-cell>{{item.someText}}</td>
62 62
                     <td md-cell>{{item.someInt}}</td>
63 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 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 67
                             <md-icon class="material-icons">mode_edit</md-icon>
68 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 70
                             <md-icon class="material-icons">delete</md-icon>
71 71
                         </md-button>
72 72
                     </td>
@@ -76,7 +76,9 @@
76 76
         </md-table-container>
77 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 83
     <div class="isa_error" ng-show="error != null">
82 84
         <i class="fa fa-times-circle"></i>

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

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

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

@@ -1,7 +1,7 @@
1 1
 <md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')">
2 2
     <header class="nav-header" ss-style-color="{'background-color': 'primary.default'}">
3 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 5
         </md-toolbar>
6 6
     </header>
7 7
     <div flex ng-controller="SideBarController">

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

@@ -1,6 +1,6 @@
1 1
 <md-toolbar layout="row" ng-controller="ToolBarController">
2 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 4
             <md-icon class="material-icons">menu</md-icon>
5 5
         </md-button>
6 6
         <h2>{{title}}</h2>

+ 3
- 1
bower.json View File

@@ -17,6 +17,8 @@
17 17
     "components-font-awesome": "^4.7.0",
18 18
     "angular-material-sidenav": "^0.0.14",
19 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,7 +6,7 @@
6 6
     'use strict';
7 7
 
8 8
     angular.module('appSdk')
9
-        .factory('AppUtilsBusiness', ['$rootScope', function($rootScope) {
9
+        .factory('AppUtilsBusiness', ['$rootScope', '$translate', function($rootScope, $translate) {
10 10
 
11 11
             var AppUtilsBusiness = {};
12 12
 
@@ -23,7 +23,7 @@
23 23
 
24 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 29
             AppUtilsBusiness.setToolbarTitle = function(title)
@@ -31,6 +31,11 @@
31 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 39
             return AppUtilsBusiness;
35 40
         }]);
36 41
 })();

Loading…
Cancel
Save