sdc-i18n-stores

1.4.1 • Public • Published

sdc-i18n-stores

Travis npm package Coveralls

This package provides stores that act as dumb containers and have no internal logic for loading any data:

  • a LabelsStore for managing the translations texts
  • a LanguagesStore for managing the available languages, in particular a default language and the currently selected language

All translation / texts need to be provided and either directly injected into the LabelsStore or published to the topic i18n.translations using the module sdc-publish-subscribe.

labelsStore.setTranslations({...})

Likewise, all languages and in particular the default language need to be provided to the LanguagesStore, either directly or by publishing to i18n.languages.defined and i18n.languages.available.

languagesStore.setLanguages({...}) // keyed by language code
languagesStore.setDefaultLanguage('xx')
languagesStore.selectLanguage('xx')()

Readme

Keywords

Package Sidebar

Install

npm i sdc-i18n-stores

Weekly Downloads

2

Version

1.4.1

License

MIT

Unpacked Size

16.2 kB

Total Files

10

Last publish

Collaborators

  • eschreiner