fix(core.gbapp): Improvements in language selection and MSTEAMS integration.
This commit is contained in:
parent
9488316013
commit
23b89e5c79
2 changed files with 15 additions and 2 deletions
|
@ -72,20 +72,24 @@ export class LanguageDialog extends IGBDialog {
|
|||
{ name: 'english', code: 'en' },
|
||||
{ name: 'inglês', code: 'en' },
|
||||
{ name: 'portuguese', code: 'pt' },
|
||||
{ name: 'português', code: 'pt' },
|
||||
{ name: 'français', code: 'fr' },
|
||||
{ name: 'francês', code: 'fr' },
|
||||
{ name: 'french', code: 'fr' },
|
||||
{ name: 'português', code: 'pt' },
|
||||
{ name: 'spanish', code: 'es' },
|
||||
{ name: 'espanõl', code: 'es' },
|
||||
{ name: 'espanhol', code: 'es' },
|
||||
{ name: 'german', code: 'de' },
|
||||
{ name: 'deutsch', code: 'de' }
|
||||
{ name: 'deutsch', code: 'de' },
|
||||
{ name: 'alemão', code: 'de' }
|
||||
];
|
||||
let translatorLocale = null;
|
||||
const text = step.context.activity['originalText'];
|
||||
|
||||
await CollectionUtil.asyncForEach(list, async item => {
|
||||
if (GBConversationalService.kmpSearch(text, item.name) != -1) {
|
||||
if (GBConversationalService.kmpSearch(text.toLowerCase(), item.name.toLowerCase()) != -1 ||
|
||||
GBConversationalService.kmpSearch(text.toLowerCase(), item.code.toLowerCase()) != -1) {
|
||||
translatorLocale = item.code;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -741,6 +741,11 @@ export class GBMinService {
|
|||
|
||||
private async processMessageActivity(context, min: GBMinInstance, step: GBDialogStep) {
|
||||
const user = await min.userProfile.get(context, {});
|
||||
|
||||
// Removes <at>Bot Id</at> from MS Teams.
|
||||
|
||||
context.activity.text = context.activity.text.trim();
|
||||
context.activity.text = context.activity.text.replace(/\<at\>.*\<\/at\>\s/gi, '')
|
||||
|
||||
let message: GuaribasConversationMessage;
|
||||
if (process.env.PRIVACY_STORE_MESSAGES === 'true') {
|
||||
|
@ -769,6 +774,7 @@ export class GBMinService {
|
|||
};
|
||||
|
||||
const isVMCall = Object.keys(min.scriptMap).find(key => min.scriptMap[key] === context.activity.text) !== undefined;
|
||||
|
||||
|
||||
if (isVMCall) {
|
||||
await GBVMService.callVM(context.activity.text, min, step, this.deployer);
|
||||
|
@ -908,6 +914,9 @@ export class GBMinService {
|
|||
|
||||
if (step.activeDialog !== undefined) {
|
||||
await step.continueDialog();
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
// Checks if any .gbapp will handle this answer, if not goes to standard kb.gbapp.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue