[TTS Plugin] Locale not working
Forge component by Fábio Fantato
Published on 23 Jun 2020

If I leave the Locale blank then it works fine, however the default is pt_BR and I need English.

I've tried en_US, en_UK and en_IE but always get the following error:

"length=1; index=1"

Rank: #132

Hello Sienna, did you look at the demo app available here: https://www.outsystems.com/forge/component-discussions/6813/Text+To+Speech+(TTS)+Sample ?

Ther you can find this note "Language resource need to be available in the device for it to work and might ask you to download the language resource files."

Also if you give a look on plugin documentation you see an example with locale "en-GB" and "en-US", can you test it?


I think this could be your problem.



Rank: #420

Hi Luis, thanks for your reply.

I hadn't checked out the sample code but have now and there are no significant differences.

As I'm implementing only a single language at this time I have hardcoded the Locale rather than using a structure (I would have used a static entity if I were, but I guess they wanted to keep it local), but that shouldn't make any difference anyway.

The Speak function works in English, it is only the SpeakWithSpeed that will only play in Portuguese. I don't know if that means I don't have the required language resource installed - but tbh I'd surprised as I'm running it on a Galaxy S10+, which is a top end phone.

If a download is required I would want to embed that as part of the install package because this needs to work on any modern device.

Btw I can't find the message you refer to in any of the modules: "Language resource need to be available in the device for it to work and might ask you to download the language resource files."

And if I run the 'require' code at runkit, I get 'cannot find module cordova-plugin-tts'.


Rank: #111


If the speak is working in English then speak with speed should also work, I have personally tried in three projects with English and speak with speed works. Regarding download of language resource file, Android/iOS should ask when you first try the TTS method. Can you share below to better assist you

  • Module of your app
  • Version of OutSystems
  • Extensibility configuration in TTS plugin


Rank: #420

Apologies for the delayed reply, been a really busy week!

Anyway for some strange reason, it is working now but I did nothing to change it and it was consistently not working across several days but since yesterday has been consistently working, very odd.

It may forever be a mystery as to what was going wrong and hopefully won't recur - but either way I still really appreciate you both reaching out to help - thank you! :)


Rank: #132

Good to know Sienna! 

Something fixed your issue :)

Happy coding

Rank: #420

Thanks :)