jovotech / jovo-cli

🛠 Command Line Interface for the Jovo Framework: Makes voice experience deployment a breeze, including features like local development and staging.
https://www.jovo.tech/marketplace/jovo-cli
Apache License 2.0
57 stars 31 forks source link

i18n Array #323

Closed alvarocardenasc closed 2 years ago

alvarocardenasc commented 2 years ago

I'm submitting a...

Expected Behavior

"translation": { "hello": ["Hello!", "Hi", "Howdy!"] } messageSSML = ${this.$t('hello')};

///Say only one of the elements in the array

Current Behavior

it sends: Hello!,Hi,Howdy! instead of only one option.

Error log

If you have an error log, please paste it here.

Your Environment

jankoenig commented 2 years ago

Hi! $t returns an array. The message and reprompt properties are then randomized based on the array. Learn more here: https://www.jovo.tech/docs/i18n#arrays-and-randomization

If you want to randomize a different element, you can use this helper https://www.jovo.tech/docs/output-helpers#randomize