[Docs] i18n


#1

In this section, you will learn how to build voice applications that support multiple languages.


This is a companion discussion topic for the original entry at https://www.jovo.tech/docs/output/i18n

#2

The i18n is actually not working for me. I tried out everything. Even with the example template “Travia” the translations do not work. Dear Jovo Team can you please fix this or mention this issue in your docs.


#3

Hi. What kind of error are you getting?


#4

Hi Jan. Unfortunately there is no error message. The text is simply not translated. The final output is the key of the text. Even if i use “this.t()” or “this.$speech.t()” or “this.$speech.addT()”. Or using a SpeechBuilder Instance to create a text. The i18n Json files are in src/i18n/de-DE.json. I checked the docs many times.


#5

Could you paste the incoming request? Is it also in de-DE?


#6

Sure:

{

* "version": "1.0",
* -

"session": {
  * "new": true,
  * "sessionId": "amzn1.echo-api.session.XXXXXXXXXXXXX",
  * -

"application": {
    * "applicationId": "amzn1.echo-sdk-ams.app.XXXXXXXXX"},
  * "attributes": { },
  * -

"user": {
    * "userId": "jovo-debugger-user"}},
* -

"context": {
  * -

"System": {
    * -

"application": {
      * "applicationId": "amzn1.echo-sdk-ams.app.XXXXXXXXXX"},
    * -

"user": {
      * "userId": "jovo-debugger-user"},
    * -

"device": {
      * "deviceId": "amzn1.ask.device.XXXXXXXXXXXXXXXXXXX",
      * -

"supportedInterfaces": {
        * "AudioPlayer": { },
        * -

"Display": {
          * "templateVersion": "1.0",
          * "markupVersion": "1.0"},
        * "VideoApp": { },
        * -

"Alexa.Presentation.APL": {
          * -

"runtime": {
            * "maxVersion": "1.0"}}}}},
  * -

"AudioPlayer": {
    * "offsetInMilliseconds": 0,
    * "playerActivity": "IDLE"}},
* -

"request": {
  * "type": "LaunchRequest",
  * "requestId": "amzn1.echo-api.request.XXXXXXXXXXXX",
  * "timestamp": "2020-02-12T14:44:46.690Z",
  * "locale": "de-DE"}

}

#7

I found a solution for this problem. My Json Files “de-DE.json” are stored in “/src/i18n/”. This seems to be the wrong place. I defined a alternative file path in config.ts. And converted the json files to ts files.

i18n: {
    resources: {
      "de-DE": require("./i18n/de-DE")
    },
    debug: true
  },

Now its working. The docs are little bit confusing at this point.