fix(core.gbapp): Translator off for two char phrases.
This commit is contained in:
parent
f5826e1f0d
commit
bd20312bad
2 changed files with 4 additions and 2 deletions
|
@ -122,7 +122,7 @@ export class AdminDialog extends IGBDialog {
|
||||||
},
|
},
|
||||||
async step => {
|
async step => {
|
||||||
const locale = step.context.activity.locale;
|
const locale = step.context.activity.locale;
|
||||||
const sensitive = step.result;
|
const sensitive = step.context.activity['originalText'];
|
||||||
|
|
||||||
if (sensitive === min.instance.adminPass) {
|
if (sensitive === min.instance.adminPass) {
|
||||||
await min.conversationalService.sendText(min, step, Messages[locale].welcome);
|
await min.conversationalService.sendText(min, step, Messages[locale].welcome);
|
||||||
|
|
|
@ -327,7 +327,7 @@ export class GBConversationalService {
|
||||||
await min.whatsAppDirectLine.sendToDevice(mobile, message, conversationId);
|
await min.whatsAppDirectLine.sendToDevice(mobile, message, conversationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static async getAudioBufferFromText(text): Promise<string> {
|
public static async getAudioBufferFromText(text): Promise<string> {
|
||||||
return new Promise<string>(async (resolve, reject) => {
|
return new Promise<string>(async (resolve, reject) => {
|
||||||
const name = GBAdminService.getRndReadableIdentifier();
|
const name = GBAdminService.getRndReadableIdentifier();
|
||||||
|
@ -851,6 +851,8 @@ export class GBConversationalService {
|
||||||
if (text.length > 5000) {
|
if (text.length > 5000) {
|
||||||
text = text.substr(0, 4999);
|
text = text.substr(0, 4999);
|
||||||
GBLog.warn(`Text that bot will translate will be truncated due to MSFT service limitations.`);
|
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('¿', '');
|
text = text.replace('¿', '');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue