question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

app.t('key') and app.speechBuilder().t('key') returning 'undefined'

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rmtuckerphxcommented, Nov 28, 2017

That was it. Thank you!

1reaction
jankoenigcommented, Nov 28, 2017

Hi @rmtuckerphx, this might be a bug, this is exactly why we allow to use the { returnObjects: true } config. We’re investigating

Read more comments on GitHub >

github_iconTop Results From Across the Web

Property 'speechBuilder' in type 'GoogleAction' is not ... - GitHub
toString(),this.t('WELCOME_RETURNING_USER_REPROMPT').toString()); ... I've tried that. Only the key is returned, not the translated value.
Read more >
Component returning undefined - Stack Overflow
Your app componetn should be responsible for holding the const stories = [. array, then you'll be able to use searchedStories in App....
Read more >
"fdk run" to return 'undefined' after what seems like a timeout ...
I'm stuck on an issue with 'fdk run'. Its been a while since I compiled (fdk run) the app and now when I...
Read more >
Google Assistant problems which fail silently - Jovo Community
I tried to reproduce your issue with empty rows in a key-value-type sheet of a Spreadsheet CMS, but for me everything was resolved...
Read more >
'chrome.app.runtime' and ' chrome.app.window' returns ...
I developed an app using `chrome.app.window.create` to create an app window. It used to work, but now it not works suddenly (I didn't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found