add many multilingual fields

add torrents and forum topbar menu
This commit is contained in:
OldHawk
2017-03-26 00:52:31 +08:00
parent ecad977de7
commit 111ab49b06
14 changed files with 112 additions and 11 deletions

View File

@@ -12,7 +12,9 @@
title: 'Articles',
state: 'articles',
type: 'dropdown',
roles: ['*']
roles: ['*'],
position: 20
});
// Add the dropdown list item

View File

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

View File

@@ -15,7 +15,12 @@
var stringcn = {
COMINGSOON: '开发中,请稍候...',
//client menu
//topbar menu
MENU_CHAT: '聊天室',
MENU_TORRENTS: '种子',
MENU_FORUMS: '论坛',
//client account menu
SIGNOUT: '退出登录',
SIGNIN: '登录',
SIGNUP: '注册',

View File

@@ -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',

View File

@@ -12,7 +12,8 @@
title: 'Admin',
state: 'admin',
type: 'dropdown',
roles: ['admin']
roles: ['admin'],
position: 11
});
}
}());

View File

@@ -5,7 +5,7 @@
.module('core')
.run(menuConfig);
menuConfig.$inject = ['menuService', '$translate', '$filter'];
menuConfig.$inject = ['menuService', '$translate'];
function menuConfig(menuService, $translate) {
menuService.addMenu('account', {

View File

@@ -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...';
}
}());

View File

@@ -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);">

View File

@@ -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>

View File

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

View File

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

View File

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

View File

@@ -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: ['*']
});
}
}());

View File

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