fixed translations

pull/1512/head
Diego Sampaio 10 years ago
parent fd12bcf2ca
commit 6214124bad
  1. 4
      packages/rocketchat-livechat/client/views/app/livechat-manager.html
  2. 18
      packages/rocketchat-livechat/client/views/app/livechatManager.js
  3. 16
      packages/rocketchat-livechat/i18n/en.i18n.json
  4. 16
      packages/rocketchat-livechat/i18n/pt.i18n.json
  5. 6
      packages/rocketchat-livechat/package.js
  6. 2
      packages/rocketchat-livechat/server/methods/addAgent.js
  7. 2
      packages/rocketchat-livechat/server/methods/addManager.js
  8. 2
      packages/rocketchat-livechat/server/methods/removeAgent.js
  9. 2
      packages/rocketchat-livechat/server/methods/removeManager.js

@ -1,4 +0,0 @@
<template name="livechat-manager">
<h1>livechat-manager</h1>
<p>Example</p>
</template>

@ -36,7 +36,7 @@ Template.livechatManager.events({
}, () => {
Meteor.call('livechat:removeManager', this.username, function(error, result) {
if (error) {
return toastr.error(error.reason || error.error);
return toastr.error(t(error.reason || error.error));
}
swal({
title: t('Removed'),
@ -63,7 +63,7 @@ Template.livechatManager.events({
}, () => {
Meteor.call('livechat:removeAgent', this.username, function(error, result) {
if (error) {
return toastr.error(error.reason || error.error);
return toastr.error(t(error.reason || error.error));
}
swal({
title: t('Removed'),
@ -89,17 +89,12 @@ Template.livechatManager.events({
Meteor.call('livechat:addManager', e.currentTarget.elements['username'].value, function(error, result) {
e.currentTarget.elements['add'].value = oldBtnValue;
if (error) {
console.log(error);
return toastr.error(error.reason || error.error);
return toastr.error(t(error.reason || error.error));
}
toastr.success(t('Manager_added'));
e.currentTarget.reset();
});
// console.log('valor ->',e.currentTarget.elements['username'].value);
// Meteor.call
},
'submit #form-agent' (e, instance) {
e.preventDefault();
@ -115,17 +110,12 @@ Template.livechatManager.events({
Meteor.call('livechat:addAgent', e.currentTarget.elements['username'].value, function(error, result) {
e.currentTarget.elements['add'].value = oldBtnValue;
if (error) {
console.log(error);
return toastr.error(error.reason || error.error);
return toastr.error(t(error.reason || error.error));
}
toastr.success(t('Agent_added'));
e.currentTarget.reset();
});
// console.log('valor ->',e.currentTarget.elements['username'].value);
// Meteor.call
}
});

@ -1,7 +1,17 @@
{
"Livechat_title" : "Livechat Title",
"Livechat_title_color" : "Livechat Title Background Color",
"Add": "Add",
"Add_agent": "Add agent",
"Add_manager": "Add manager",
"Agent_added": "Agent added",
"Agent_removed": "Agent removed",
"Enter_a_username": "Enter a username",
"Livechat_agents": "Livechat agents",
"Livechat_Manager": "Livechat Manager",
"Livechat_managers": "Livechat managers",
"Livechat_agents": "Livechat agents"
"Livechat_title" : "Livechat Title",
"Livechat_title_color" : "Livechat Title Background Color",
"Manager_added": "Manager added",
"Manager_removed": "Manager removed",
"Please_fill_a_username": "Please fill a username",
"Username_not_found": "Username not found"
}

@ -1,7 +1,17 @@
{
"Add": "Adicionar",
"Add_agent": "Adicionar agente",
"Add_manager": "Adicionar gerente",
"Agent_added": "Agente adicionado",
"Agent_removed": "Agente removido",
"Enter_a_username": "Nome de usuário",
"Livechat_agents": "Agentes do Livechat",
"Livechat_Manager": "Administração Livechat",
"Livechat_managers": "Gerentes do Livechat",
"Livechat_title" : "Título Livechat",
"Livechat_title_color" : "Cor de fundo do título do Livechat",
"Livechat_Manager": "Administração Livechat",
"Livechat_managers": "Gerenciadores do Livechat ",
"Livechat_agents": "Agentes do Livechat"
"Manager_added": "Gerente adicionado",
"Manager_removed": "Gerente removido",
"Please_fill_a_username": "Por favor preencha um nome de usuário",
"Username_not_found": "Nome de usuário não encontrado"
}

@ -23,6 +23,7 @@ Package.onUse(function(api) {
api.use('alanning:roles@1.2.12');
api.use('rocketchat:lib');
api.use('kadira:flow-router', 'client');
api.use('templating', 'client');
api.addFiles('livechat.js', 'server');
api.addFiles('server/methods.js', 'server');
@ -60,7 +61,6 @@ Package.onUse(function(api) {
api.addAssets('public/head.html', 'server');
// TAPi18n
api.use('templating', 'client');
var _ = Npm.require('underscore');
var fs = Npm.require('fs');
tapi18nFiles = _.compact(_.map(fs.readdirSync('packages/rocketchat-livechat/i18n'), function(filename) {
@ -68,7 +68,7 @@ Package.onUse(function(api) {
return 'i18n/' + filename;
}
}));
api.use('tap:i18n@1.6.1', ['client', 'server']);
api.imply('tap:i18n');
api.use('tap:i18n', ['client', 'server']);
// api.imply('tap:i18n');
api.addFiles(tapi18nFiles, ['client', 'server']);
});

@ -13,7 +13,7 @@ Meteor.methods({
var user = RocketChat.models.Users.findOneByUsername(username, { fields: { _id: 1 } });
if (!user) {
throw new Meteor.Error('user-not-found', TAPi18n.__('Username_not_found'));
throw new Meteor.Error('user-not-found', 'Username_not_found');
}
if (RocketChat.authz.addUsersToRoles(user._id, 'livechat-agent')) {

@ -13,7 +13,7 @@ Meteor.methods({
var user = RocketChat.models.Users.findOneByUsername(username, { fields: { _id: 1 } });
if (!user) {
throw new Meteor.Error('user-not-found', TAPi18n.__('Username_not_found'));
throw new Meteor.Error('user-not-found', 'Username_not_found');
}
return RocketChat.authz.addUsersToRoles(user._id, 'livechat-manager');

@ -13,7 +13,7 @@ Meteor.methods({
var user = RocketChat.models.Users.findOneByUsername(username, { fields: { _id: 1 } });
if (!user) {
throw new Meteor.Error('user-not-found', TAPi18n.__('Username_not_found'));
throw new Meteor.Error('user-not-found', 'Username_not_found');
}
if (RocketChat.authz.removeUsersFromRoles(user._id, 'livechat-agent')) {

@ -13,7 +13,7 @@ Meteor.methods({
var user = RocketChat.models.Users.findOneByUsername(username, { fields: { _id: 1 } });
if (!user) {
throw new Meteor.Error('user-not-found', TAPi18n.__('Username_not_found'));
throw new Meteor.Error('user-not-found', 'Username_not_found');
}
return RocketChat.authz.removeUsersFromRoles(user._id, 'livechat-manager');

Loading…
Cancel
Save