Closed finnbear closed 2 years ago
Just noticed that in the i18n code example, the non-English language is named two different things:
The model is called de-DE.json
:
https://github.com/jovotech/jovo-framework/blob/master/examples/javascript/i18n/models/de-DE.json
But the translation is called de.js
:
https://github.com/jovotech/jovo-framework/blob/master/examples/javascript/i18n/src/i18n/de.js
English, by contrast, has en-US
in the filename for both model and translation. What is the intention behind the difference?
I also notice that this example has only one intent:
app.setHandler({
LAUNCH() {
// this.$speech.t('WELCOME_ARRAY');
// return this.tell(this.$cms.resources);
console.log(this.t('WELCOME_GLOBAL'));
this.tell(this.t('WELCOME'));
},
});
My launch intent does work, and I fully believe this example's launch intent would work too. However, if it isn't already, the case of multiple intents with multiple languages should be documented (and demonstrated in examples).
I close this issue due to inactivity.
I'm submitting a...
Expected Behavior
If I create two i18n src files and two model files,
en-US.json
andes-ES.json
, Jovo should do what is necessary for Dialogflow to recognize Spanish as a 2nd supported language. Specifically, instead of only creating*_es.json
(entities and intents), create*_es-es.json
which may be a duplicate of*_es.json
.I am basing this understanding on exporting my agent from Dialogflow after manually setting
es
->es-ES
as a language:Side note: Dialogflow seems to prefer
es
andes-ES
to both be present, as this is how exported agents that were manually set to supportes
->es-ES
are configured:Current Behavior
Regardless of the configured
supportedLanguages
inagent.json
, Dialogflow ends up only recognizing one language and locale,en
->en-US
The issue seems to be that jovo only exports
*_es.json
but not*_es-es.json
. When Dialogflow can't find*_es-es.json
entities and intents, it disables support fores
->es_ES
.I considered manually duplicating my
es-ES.json
intoes.json
but that wouldn't work becausees-ES.json
is already converted to*_es.json
, not*_es-es.json
.Your Environment
Configuration
config.js
module.exports = { logging: true, intentMap: { 'AMAZON.StopIntent': 'END', }, i18n: { fallbackLng: { 'en': ['en-US'], 'default': ['en-US'] } } };
project.js
module.exports = { alexaSkill: { nlu: { name: 'alexa' } }, googleAction: { nlu: { name: 'dialogflow', agent: { supportedLanguages: [ "en-us", "es", "es-es" ] } } }, defaultStage: 'dev', stages: { dev: { endpoint: '${JOVO_WEBHOOK_URL}' }, prod: { alexaSkill: { endpoint: "arn:aws:lambda:us-XXX-X:XXXX:function:jovo-voice-app" }, googleAction: { dialogflow: { endpoint: "https://XXXXXX.execute-api.us-XXXX-X.amazonaws.com/prod", keyFile: "./google-action-key.json", projectId: "jovo-voice-app-XXXXXX" }, host: { lambda: { arn: 'arn:aws:lambda:us-XXXX-X:XXXX:function:jovo-voice-app' } } } } } }