FS-8972 - [verto_communicator] add i18n using angular-translate and static file loader

This commit is contained in:
Davide Colombo
2016-03-23 11:15:44 +01:00
parent ad72c7f56c
commit 6c197ae2f0
23 changed files with 504 additions and 191 deletions

View File

@@ -5,9 +5,9 @@
angular
.module('vertoControllers')
.controller('ChatController', ['$scope', '$rootScope', '$http',
'$location', '$anchorScroll', '$timeout', 'verto', 'prompt',
'$location', '$anchorScroll', '$timeout', 'verto', 'prompt', '$translate',
function($scope, $rootScope, $http, $location, $anchorScroll, $timeout,
verto, prompt) {
verto, prompt, $translate) {
console.debug('Executing ChatController.');
function scrollToChatBottom() {
@@ -246,7 +246,7 @@
console.log('$scope.confBanner');
prompt({
title: 'Please insert the banner text',
title: $translate.instant('TITLE_INSERT_BANNER'),
input: true,
label: '',
value: '',
@@ -263,7 +263,7 @@
return;
}
shortPrompt('Please insert the Canvas Id', function(canvasID) {
shortPrompt($translate.instant('TITLE_INSERT_CANVAS_ID'), function(canvasID) {
console.log(memberID, canvasID);
verto.setCanvasIn(memberID, canvasID);
});
@@ -276,7 +276,7 @@
return;
}
shortPrompt('Please insert the Canvas Id', function(canvasID) {
shortPrompt($translate.instant('TITLE_INSERT_CANVAS_ID'), function(canvasID) {
verto.setCanvasOut(memberID, canvasID);
});
};
@@ -287,7 +287,7 @@
return;
}
shortPrompt('Please insert the Layer', function(canvasID) {
shortPrompt($translate.instant('TITLE_INSERT_LAYER'), function(canvasID) {
verto.setLayer(memberID, canvasID);
});
};
@@ -321,10 +321,10 @@
$scope.confTransfer = function(memberID) {
console.log('$scope.confTransfer');
prompt({
title: 'Transfer party?',
message: 'To what destination would you like to transfer this call?',
title: $translate.instant('TITLE_TRANSFER'),
message: $translate.instant('MESSAGE_TRANSFER'),
input: true,
label: 'Destination',
label: $translate.instant('LABEL_TRANSFER'),
value: '',
}).then(function(exten) {
if (exten) {

View File

@@ -4,9 +4,9 @@
angular
.module('vertoControllers')
.controller('InCallController', ['$rootScope', '$scope',
'$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen',
'$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen', '$translate',
function($rootScope, $scope, $http, $location, $modal, $timeout, toastr,
verto, storage, prompt, Fullscreen) {
verto, storage, prompt, Fullscreen, $translate) {
console.debug('Executing InCallController.');
$scope.layout = null;
@@ -55,8 +55,8 @@
*/
$scope.videoCall = function() {
prompt({
title: 'Would you like to activate video for this call?',
message: 'Video will be active during the next calls.'
title: $translate.instant('TITLE_ENABLE_VIDEO'),
message: $translate.instant('MESSAGE_ENABLE_VIDEO')
}).then(function() {
storage.data.videoCall = true;
$scope.callTemplate = 'partials/video_call.html';

View File

@@ -4,7 +4,7 @@
angular
.module('vertoControllers')
.controller('MainController',
function($scope, $rootScope, $location, $modal, $timeout, $q, verto, storage, CallHistory, toastr, Fullscreen, prompt, eventQueue) {
function($scope, $rootScope, $location, $modal, $timeout, $q, verto, storage, CallHistory, toastr, Fullscreen, prompt, eventQueue, $translate) {
console.debug('Executing MainController.');
@@ -123,8 +123,8 @@
if (verto.data.call) {
prompt({
title: 'Oops, Active Call in Course.',
message: 'It seems that you are in a call. Do you want to hang up?'
title: $translate.instant('TITLE_ACTIVE_CALL'),
message: $translate.instant('MESSAGE_ACTIVE_CALL_HANGUP')
}).then(function() {
disconnect();
});
@@ -326,8 +326,8 @@
return $q(function(resolve, reject) {
if (storage.data.askRecoverCall) {
prompt({
title: 'Oops, Active Call in Course.',
message: 'It seems you were in a call before leaving the last time. Wanna go back to that?'
title: $translate.instant('TITLE_ACTIVE_CALL'),
message: $translate.instant('MESSAGE_ACTIVE_CALL_BACK')
}).then(function() {
console.log('redirect to incall page');
$location.path('/incall');
@@ -423,8 +423,8 @@
storage.data.mutedMic = false;
prompt({
title: 'Incoming Call',
message: 'from ' + data
title: $translate.instant('TITLE_INCOMING_CALL'),
message: $translate.instant('MESSAGE_INCOMING_CALL') + data
}).then(function() {
var call_start = new Date(storage.data.call_start);
$rootScope.start_time = call_start;
@@ -450,7 +450,7 @@
*/
$scope.hangup = function() {
if (!verto.data.call) {
toastr.warning('There is no call to hangup.');
toastr.warning($translate.instant('MESSAGE_NO_HANGUP_CALL'));
$location.path('/dialpad');
return;
}
@@ -501,7 +501,7 @@
};
$scope.play = function() {
var file = $scope.promptInput('Please, enter filename', '', 'File',
var file = $scope.promptInput($translate.instant('MESSAGE_ENTER_FILENAME'), '', 'File',
function(file) {
verto.data.conf.play(file);
console.log('play file :', file);
@@ -514,7 +514,7 @@
};
$scope.record = function() {
var file = $scope.promptInput('Please, enter filename', '', 'File',
var file = $scope.promptInput($translate.instant('MESSAGE_ENTER_FILENAME'), '', 'File',
function(file) {
verto.data.conf.record(file);
console.log('recording file :', file);
@@ -526,7 +526,7 @@
};
$scope.snapshot = function() {
var file = $scope.promptInput('Please, enter filename', '', 'File',
var file = $scope.promptInput($translate.instant('MESSAGE_ENTER_FILENAME'), '', 'File',
function(file) {
verto.data.conf.snapshot(file);
console.log('snapshot file :', file);

View File

@@ -4,9 +4,9 @@
angular
.module('vertoControllers')
.controller('PreviewController', ['$rootScope', '$scope',
'$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen',
'$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen', '$translate',
function($rootScope, $scope, $http, $location, $modal, $timeout, toastr,
verto, storage, prompt, Fullscreen) {
verto, storage, prompt, Fullscreen, $translate) {
$scope.storage = storage;
console.debug('Executing PreviewController.');
@@ -87,8 +87,8 @@
$scope.videoCall = function() {
prompt({
title: 'Would you like to activate video for this call?',
message: 'Video will be active during the next calls.'
title: $translate.instant('TITLE_ENABLE_VIDEO'),
message: $translate.instant('MESSAGE_ENABLE_VIDEO')
}).then(function() {
storage.data.videoCall = true;
$scope.callTemplate = 'partials/video_call.html';

View File

@@ -4,8 +4,8 @@
angular
.module('vertoControllers')
.controller('SettingsController', ['$scope', '$http',
'$location', '$rootScope', 'storage', 'verto',
function($scope, $http, $location, $rootScope, storage, verto) {
'$location', '$rootScope', 'storage', 'verto', '$translate',
function($scope, $http, $location, $rootScope, storage, verto, $translate) {
console.debug('Executing ModalSettingsController.');
$.material.init();
@@ -47,7 +47,7 @@
return;
}
else {
toastr.warning('Can\'t display preview settings during a call');
toastr.warning($translate.instant('MESSAGE_DISPLAY_SETTINGS'));
}
};