Skip to content

Commit

Permalink
Merge branch 'master' into update/deps
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDzvonik authored Apr 19, 2018
2 parents 32b3c00 + 623d567 commit 32bbe90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ These are the steps required to localize your existing application:
2. Initialize `i18next` instance - see [the example app](examples/multi-language/multi-language-app.js)
3. Set `i18next` instance to your app to enable localization: `app.setI18next(i18next)`
4. Create directory with all locales
5. Ommit utterances in all intents and access the translate function using `app.t('key')`
5. Omit utterances in all intents and access the translate function using `app.t('key')`

Localized intent example:

Expand All @@ -400,7 +400,7 @@ Localization notes:
- To localize built in intents, say `AMAZON.YesIntent` use entry names after the `.` suffix. So `AMAZON.YesIntent` becomes just `YesIntent`
- To access the translation use: `app.t('key')` This `key` needs to be nested in the current intent translation entry. You don't have to use the full path to the key - the prefix is automatically added depending on the current request
- Each intent translation should have `utterances` property. We support the `richUtterances` syntax f.e: `My age is {age:Number}`
- The locale to be used is decided depending on the `data.request.locale` Its value could be currently one of: `en-US`, `en-GB`, `de-DE`
- The locale to be used is decided depending on the `data.request.locale` Its value could be currently one of: `en-US`, `en-GB`, `en-CA`, `en-IN`, `en-AU`, `de-DE`, `fr-FR`, `ja-JP`

### Handling Amazon Requests

Expand Down Expand Up @@ -456,13 +456,15 @@ server.start()
### Heroku

1. Create free [Heroku](https://www.heroku.com) acount
2. Install [Heroku toolbelt](https://toolbelt.heroku.com/)
2. Install [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)
- ensure that you don’t have the legacy Heroku Toolbelt or Heroku Ruby gem installed
3. Be sure to have `start` script defined in `package.json`
4. Be sure to create server handler on POST endpoint. See [Handling Amazon Requests](#handling-amazon-requests)
5. Run `git init` if git was not yet initialized in your project
6. Run `heroku create` in project directory
7. Run `git push heroku master`
8. Copy your server URL to your Alexa Skill configuration. See [Create Alexa Skill](#create-alexa-skill)
6. Be sure to `heroku login` and enter your credentials
7. Run `heroku create` in project directory
8. Run `git push heroku master`
9. Copy your server URL to your Alexa Skill configuration. See [Create Alexa Skill](#create-alexa-skill)

### AWS Lambda

Expand Down
2 changes: 1 addition & 1 deletion examples/multi-language/locales/de/custom-slots.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"item": ["Michael", "Michal", "Slavomir"]
"Name": ["Michael", "Michal", "Slavomir"]
}
2 changes: 1 addition & 1 deletion examples/multi-language/locales/en/custom-slots.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"item": ["Michael", "Michal", "Slavomir"]
"Name": ["Michael", "Michal", "Slavomir"]
}
2 changes: 1 addition & 1 deletion src/generate-speech-assets-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const genIntentSchemaAndUtterances = (app, locale) => {
// Transform intent utterances to array if its string
let intentUtterances = _.isArray(intentResource.utterances) ? intentResource.utterances : [intentResource.utterances];

// Parse rich utterances to extract slot types and transform utterances to simle form
// Parse rich utterances to extract slot types and transform utterances to simple form
parseRichUtterances(intentUtterances, slots, utterances);

// Slots found
Expand Down

0 comments on commit 32bbe90

Please sign in to comment.