Skip to content

Commit

Permalink
add many multilingual fields
Browse files Browse the repository at this point in the history
add torrents and forum topbar menu
  • Loading branch information
taobataoma committed Mar 25, 2017
1 parent ecad977 commit 111ab49
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 11 deletions.
4 changes: 3 additions & 1 deletion modules/articles/client/config/articles.client.menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
title: 'Articles',
state: 'articles',
type: 'dropdown',
roles: ['*']
roles: ['*'],
position: 20

});

// Add the dropdown list item
Expand Down
9 changes: 5 additions & 4 deletions modules/chat/client/config/chat.client.menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
.module('chat')
.run(menuConfig);

menuConfig.$inject = ['menuService'];
menuConfig.$inject = ['menuService', '$translate'];

function menuConfig(menuService) {
function menuConfig(menuService, $translate) {
// Set top bar menu items
menuService.addMenuItem('topbar', {
title: 'Chat',
state: 'chat'
title: $translate.instant('MENU_CHAT'),
state: 'chat',
position: 10
});
}
}());
7 changes: 6 additions & 1 deletion modules/core/client/app/trans-string-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
var stringcn = {
COMINGSOON: '开发中,请稍候...',

//client menu
//topbar menu
MENU_CHAT: '聊天室',
MENU_TORRENTS: '种子',
MENU_FORUMS: '论坛',

//client account menu
SIGNOUT: '退出登录',
SIGNIN: '登录',
SIGNUP: '注册',
Expand Down
5 changes: 5 additions & 0 deletions modules/core/client/app/trans-string-en.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
var stringen = {
COMINGSOON: 'coming soon...',

//client menu
MENU_CHAT: 'Chat',
MENU_TORRENTS: 'Torrents',
MENU_FORUMS: 'Forums',

//client menu
SIGNOUT: 'Signout',
SIGNIN: 'Sign In',
Expand Down
3 changes: 2 additions & 1 deletion modules/core/client/config/core-admin.client.menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
title: 'Admin',
state: 'admin',
type: 'dropdown',
roles: ['admin']
roles: ['admin'],
position: 11
});
}
}());
2 changes: 1 addition & 1 deletion modules/core/client/config/core.client.menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.module('core')
.run(menuConfig);

menuConfig.$inject = ['menuService', '$translate', '$filter'];
menuConfig.$inject = ['menuService', '$translate'];

function menuConfig(menuService, $translate) {
menuService.addMenu('account', {
Expand Down
8 changes: 7 additions & 1 deletion modules/core/client/controllers/home.client.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
.module('core')
.controller('HomeController', HomeController);

function HomeController() {
HomeController.$inject = ['$scope', '$translate'];

function HomeController($scope, $translate) {
var vm = this;

//$translate.use('en');

vm.COMING = 'coming soon...';
}
}());
2 changes: 1 addition & 1 deletion modules/core/client/views/header.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a ui-sref="home" class="navbar-brand">meanTorrent</a>
<a ui-sref="home" class="navbar-brand"><span style="font-size: 25px; font-weight: bold; line-height: 16px;">meanTorrent</span></a>
</div>
<nav class="navbar-collapse" uib-collapse="!vm.isCollapsed" role="navigation">
<ul class="nav navbar-nav" ng-if="vm.menu.shouldRender(vm.authentication.user);">
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/views/home.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="jumbotron text-center">
<div class="row">
<div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 col-xs-12">
<h1>Coming soon ...</h1>
<h1 translate="COMINGSOON"></h1>
</div>
</div>
</div>
Expand Down
18 changes: 18 additions & 0 deletions modules/forums/client/config/forums.client.menus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(function () {
'use strict';

angular
.module('forums')
.run(menuConfig);

menuConfig.$inject = ['menuService', '$translate'];

function menuConfig(menuService, $translate) {
// Set top bar menu items
menuService.addMenuItem('topbar', {
title: $translate.instant('MENU_FORUMS'),
state: 'forums',
position: 1
});
}
}());
23 changes: 23 additions & 0 deletions modules/forums/client/config/forums.client.routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(function () {
'use strict';

angular
.module('forums.routes')
.config(routeConfig);

routeConfig.$inject = ['$stateProvider'];

function routeConfig($stateProvider) {
$stateProvider
.state('forums', {
url: '/forums',
templateUrl: '',
controller: '',
controllerAs: '',
data: {
//roles: ['user', 'admin'],
pageTitle: 'Forums'
}
});
}
}());
7 changes: 7 additions & 0 deletions modules/forums/client/forums.client.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function (app) {
'use strict';

app.registerModule('forums', ['core']);// The core module is required for special route handling; see /core/client/config/core.client.routes
app.registerModule('forums.services');
app.registerModule('forums.routes', ['ui.router', 'core.routes', 'forums.services']);
}(ApplicationConfiguration));
26 changes: 26 additions & 0 deletions modules/torrents/client/config/torrents.client.menus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(function () {
'use strict';

angular
.module('torrents')
.run(menuConfig);

menuConfig.$inject = ['menuService', '$translate'];

function menuConfig(menuService, $translate) {
menuService.addMenuItem('topbar', {
title: $translate.instant('MENU_TORRENTS'),
state: 'torrents',
type: 'dropdown',
roles: ['*'],
position: 0
});

// Add the dropdown list item
menuService.addSubMenuItem('topbar', 'torrents', {
title: 'List torrents',
state: 'torrents.list',
roles: ['*']
});
}
}());
7 changes: 7 additions & 0 deletions modules/torrents/client/torrents.client.module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(function (app) {
'use strict';

app.registerModule('torrents', ['core']);// The core module is required for special route handling; see /core/client/config/core.client.routes
app.registerModule('torrents.services');
app.registerModule('torrents.routes', ['ui.router', 'core.routes', 'torrents.services']);
}(ApplicationConfiguration));

0 comments on commit 111ab49

Please sign in to comment.