fix(core.gbapp): Language instance acquisition fixed.

This commit is contained in:
Rodrigo Rodriguez 2020-11-26 11:25:04 -03:00
parent 2b74c3c7e1
commit 387b3407f3
2 changed files with 8 additions and 2 deletions

View file

@ -532,8 +532,12 @@ export class GBConversationalService {
} }
public async getLanguage(min: GBMinInstance, text: string): Promise<string> { public async getLanguage(min: GBMinInstance, text: string): Promise<string> {
const key = min.core.getParam<string>(min.instance, 'textAnalyticsKey', null);
if (!key) {
return process.env.DEFAULT_USER_LANGUAGE;
}
return await AzureText.getLocale( return await AzureText.getLocale(
min.core.getParam<string>(min.instance, 'textAnalyticsKey', null), key,
min.core.getParam<string>(min.instance, 'textAnalyticsEndpoint', null), min.core.getParam<string>(min.instance, 'textAnalyticsEndpoint', null),
text text
); );

View file

@ -594,9 +594,11 @@ STORAGE_SYNC=true
value = instance['dataValues'][name]; value = instance['dataValues'][name];
if (value === null) { if (value === null) {
const minBoot = GBServer.globals.minBoot as any; const minBoot = GBServer.globals.minBoot as any;
if (minBoot.instance && minBoot.instance.datavalues){
value = minBoot.instance.datavalues[name]; value = minBoot.instance.datavalues[name];
} }
} }
}
return value; return value;
} }