Skip to content

Commit

Permalink
Add translations and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Mar 9, 2017
1 parent cf61884 commit 76a651f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/rocketchat-google-natural-language/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import './settings.js';
import './models/Rooms.js';

const getMessageSentiment = function(message) {
const Language = Npm.require('@google-cloud/language');
const googleLanguage = Npm.require('@google-cloud/language');

const languageClient = Language({
const languageClient = googleLanguage({
credentials: JSON.parse(RocketChat.settings.get('GoogleNaturalLanguage_ServiceAccount'))
});

Expand Down
10 changes: 6 additions & 4 deletions packages/rocketchat-google-natural-language/server/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ Meteor.startup(function() {
RocketChat.settings.add('GoogleNaturalLanguage_Enabled', false, {
type: 'boolean',
group: 'Message',
section: 'GoogleNaturalLanguage',
public: true
section: 'Google Natural Language',
public: true,
i18nLabel: 'Enabled'
});
RocketChat.settings.add('GoogleNaturalLanguage_ServiceAccount', '', {
type: 'string',
group: 'Message',
section: 'GoogleNaturalLanguage',
section: 'Google Natural Language',
multiline: true,
enableQuery: {
_id: 'GoogleNaturalLanguage_Enabled',
value: true
}
},
i18nLabel: 'Service_account_key'
});
});
2 changes: 2 additions & 0 deletions packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@
"Give_the_application_a_name_This_will_be_seen_by_your_users": "Give the application a name. This will be seen by your users.",
"Global": "Global",
"GoogleCloudStorage": "Google Cloud Storage",
"GoogleNaturalLanguage_ServiceAccount_Description": "Service account key JSON file. More information can be found [here](https://cloud.google.com/natural-language/docs/common/auth#set_up_a_service_account)",
"GoogleTagManager_id": "Google Tag Manager Id",
"Guest_Pool": "Guest Pool",
"Hash": "Hash",
Expand Down Expand Up @@ -1304,6 +1305,7 @@
"Sending": "Sending...",
"Served_By": "Served By",
"Service": "Service",
"Service_account_key": "Service account key",
"Set_as_moderator": "Set as moderator",
"Set_as_owner": "Set as owner",
"Settings": "Settings",
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/views/app/room.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ userCanDrop = (_id) ->

Template.room.helpers
sentimentSmile: ->
room = ChatRoom.findOne this._id
room = ChatRoom.findOne this._id, fields: sentiment: 1

if room.sentiment >= 0.3
return ':)'
Expand Down

0 comments on commit 76a651f

Please sign in to comment.