feat: Add Google Translate API Integration (#6454)

This commit is contained in:
Pranav Raj S
2023-02-15 20:50:45 -08:00
committed by GitHub
parent c12bdc8350
commit 80784e3cab
17 changed files with 229 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import {
import messageReadActions from './actions/messageReadActions';
import AnalyticsHelper from '../../../helper/AnalyticsHelper';
import { CONVERSATION_EVENTS } from '../../../helper/AnalyticsHelper/events';
import messageTranslateActions from './actions/messageTranslateActions';
// actions
const actions = {
getConversation: async ({ commit }, conversationId) => {
@@ -341,6 +342,7 @@ const actions = {
commit(types.CLEAR_CONVERSATION_FILTERS);
},
...messageReadActions,
...messageTranslateActions,
};
export default actions;

View File

@@ -0,0 +1,15 @@
import MessageApi from '../../../../api/inbox/message';
export default {
async translateMessage(_, { conversationId, messageId, targetLanguage }) {
try {
await MessageApi.translateMessage(
conversationId,
messageId,
targetLanguage
);
} catch (error) {
// ignore error
}
},
};

View File

@@ -17,7 +17,7 @@ const state = {
};
const isAValidAppIntegration = integration => {
return ['dialogflow', 'dyte'].includes(integration.id);
return ['dialogflow', 'dyte', 'google_translate'].includes(integration.id);
};
export const getters = {
getIntegrations($state) {