app.t('key') and app.speechBuilder().t('key') returning 'undefined'
See original GitHub issueI am using jovo-framework@0.6.19
Here is the app configuration:
const app = require('jovo-framework').Jovo;
exports.handler = function (event, context, callback) {
let languageResources = require('./languageResources');
let intentMap = {
'AMAZON.HelpIntent': 'HelpIntent',
'AMAZON.StopIntent': 'StopIntent',
'AMAZON.CancelIntent': 'StopIntent',
'given-name': 'name'
};
app.setConfig({
requestLogging: true,
responseLogging: true,
saveUserOnResponseEnabled: true,
i18n: {
resources: languageResources,
config: { returnObjects: true },
},
});
app.handleRequest(event, callback, handlers);
app.execute();
};
And the languageResources.json file:
{
"en-US": {
"translation": {
"Test": "the answer",
"Welcome": [
{
"Message": "Welcome message one.",
"Hint": "Welcome message one hint.",
"Prompt": "How can I help?",
"Reprompt": "Welcome message one reprompt or ask for help for more options. What would you like?"
}
],
"WelcomeBackMessage": [
"Welcome back!.",
"Good to see you again."
],
"WelcomeBackPrompt": [
"What would you like to do?",
"How can I help?",
"What would you like?"
],
"WelcomeBackReprompt": [
"Welcome back one reprompt. You can ask for help for more options. What would you like?",
"Welcome back two reprompt. I can help you find an urgent care near you. For more options, say 'Help'. What would you like?"
],
"Hints": [
"hint 1",
"hint 2"
]
}
}
}
Here are the various responses that I get when I try to get to the resources: app.t(‘Test’) “the answer”
app.t(‘Welcome’) undefined
app.t(‘WelcomeBackMessage’) undefined
app.t(‘WelcomeBackPrompt’) undefined
app.t(‘WelcomeBackReprompt’) undefined
app.t(‘Hints’) undefined
app.speechBuilder().t(‘Test’).speech “the answer”
app.speechBuilder().t(‘Welcome’).speech “undefined”
app.speechBuilder().t(‘WelcomeBackMessage’).speech “undefined”
app.speechBuilder().t(‘WelcomeBackPrompt’).speech “undefined”
app.speechBuilder().t(‘WelcomeBackReprompt’).speech “undefined”
app.speechBuilder().t(‘Hints’).speech “undefined”
app.speech.t(‘Test’).speech “the answer the answer the answer”
app.speech.t(‘Welcome’).speech “the answer the answer the answer undefined”
app.speech.t(‘WelcomeBackMessage’).speech “the answer the answer the answer undefined undefined”
app.speech.t(‘WelcomeBackPrompt’).speech “the answer the answer the answer undefined undefined undefined”
app.speech.t(‘WelcomeBackReprompt’).speech “the answer the answer the answer undefined undefined undefined undefined”
app.speech.t(‘Hints’).speech “the answer the answer the answer undefined undefined undefined undefined undefined”
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top GitHub Comments
That was it. Thank you!
Hi @rmtuckerphx, this might be a bug, this is exactly why we allow to use the { returnObjects: true } config. We’re investigating