In this module we explain how to use i18next to do the internationalization of your skill. We got rid of the sprintf module and now we're using plain i18next for string replacement if necessary. We also introduce interceptors and attributtes.
- Developer Console: adding an extra locale (es-ES, translated from en-US)
- Code Tab: i18next dependency, sprintf, languageStrings (embedded for now)
- Code Tab: Request and Response Interceptors (loggers), Localisation Interceptor (simplest, no arrays)
- Code Tab: Attributes Manager, Request Attributes, requestAttributes.t and requestAttributes.t with parameters (string replacement)
- Multiple models per local
- Key/value string resources
- Enriching request attributes with t function
- Attribute manager as key/value store
- High level attribute type (request(short term), session(med term), persistent(long term))
- lambda/custom/package.json: add i18next dependencie, update all existing dependencies to latest versions
- lambda/custom/index.js: add i18next requires, add languageStrings, get request attributes in all handlers and fetch localisation strings via function t, add 3 interceptors (log request, log response and localization interceptor), add them to the exports via Alexa skill builder (bottom of file)
- models/es-ES.json: add this file copied from en-US.json and translate