Skip to content

Commit

Permalink
fix(core.gbapp): Translator off for two char phrases.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Aug 26, 2022
1 parent f5826e1 commit bd20312
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/admin.gbapp/dialogs/AdminDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class AdminDialog extends IGBDialog {
},
async step => {
const locale = step.context.activity.locale;
const sensitive = step.result;
const sensitive = step.context.activity['originalText'];

if (sensitive === min.instance.adminPass) {
await min.conversationalService.sendText(min, step, Messages[locale].welcome);
Expand Down
4 changes: 3 additions & 1 deletion packages/core.gbapp/services/GBConversationalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class GBConversationalService {
await min.whatsAppDirectLine.sendToDevice(mobile, message, conversationId);
}


public static async getAudioBufferFromText(text): Promise<string> {
return new Promise<string>(async (resolve, reject) => {
const name = GBAdminService.getRndReadableIdentifier();
Expand Down Expand Up @@ -851,6 +851,8 @@ export class GBConversationalService {
if (text.length > 5000) {
text = text.substr(0, 4999);
GBLog.warn(`Text that bot will translate will be truncated due to MSFT service limitations.`);
} else if (text.length == 2) {
return text;
}
text = text.replace('¿', '');

Expand Down

0 comments on commit bd20312

Please sign in to comment.