1.0.1 • Published 7 years ago

alexa-ssml-jsx-l10n v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

alexa-ssml-jsx-l10n

This package provides a convenient way to localize skills developed with the alexa-ssml-jsx package.

Example usage

import ssml from 'alexa-ssml-jsx';
import L10n from 'alexa-ssml-jsx-l10n';

const l10n = new L10n({
  'HELLO_WORLD': {
    'de_DE': <speak>Hallo Welt!</speak>,
    'en_EN': <speak>Hello World!</speak>
  },
  'GREETING': {
    'de_DE': (p) => <speak>Hallo {p.firstName}!</speak>,
    'en_EN': (p) => <speak>Hello {p.firstName}!</speak>
  }
});

l10n.get('HELLO_WORLD', 'de_DE');
l10n.get('GREETING', 'en_EN', { 'firstName': 'Alexa'});

Development

build

npm run build

This transpiles the example/example.jsx file into the test directory.

test

npm run test