lion/packages/localize
CircleCI 417b37a616 chore: release new versions
- @lion/ajax@0.2.5
 - @lion/button@0.5.6
 - @lion/calendar@0.6.10
 - @lion/checkbox-group@0.6.4
 - @lion/checkbox@0.3.12
 - @lion/choice-input@0.6.2
 - @lion/core@0.4.4
 - @lion/dialog@0.4.6
 - @lion/field@0.9.2
 - @lion/fieldset@0.7.2
 - @lion/form-system@0.4.6
 - @lion/form@0.4.12
 - @lion/helpers@0.3.2
 - @lion/icon@0.3.4
 - @lion/input-amount@0.5.12
 - @lion/input-date@0.5.12
 - @lion/input-datepicker@0.8.16
 - @lion/input-email@0.5.12
 - @lion/input-iban@0.5.13
 - @lion/input-range@0.2.12
 - @lion/input@0.5.12
 - @lion/localize@0.8.7
 - @lion/option@0.5.2
 - @lion/overlays@0.12.2
 - @lion/radio-group@0.6.3
 - @lion/radio@0.4.2
 - @lion/select-rich@0.10.4
 - @lion/select@0.5.12
 - @lion/steps@0.3.4
 - @lion/switch@0.5.14
 - @lion/tabs@0.2.4
 - @lion/textarea@0.5.13
 - @lion/tooltip@0.8.2
 - @lion/validate@0.6.7
2020-02-19 20:54:44 +00:00
..
docs feat: remove all deprecations from lion 2019-11-13 11:00:48 +01:00
src fix(localize): if locale is set to tr, currency TRY should display TL 2020-02-03 10:44:35 +03:00
stories fix: update links in stories 2020-01-23 18:24:38 +01:00
test fix(localize): if locale is set to tr, currency TRY should display TL 2020-02-03 10:44:35 +03:00
test-helpers fix: public test-helpers 2019-07-30 15:50:53 +02:00
CHANGELOG.md chore: release new versions 2020-02-19 20:54:44 +00:00
index.js feat(localize): add getCurrencyName 2019-11-27 13:40:15 +01:00
package.json chore: release new versions 2020-02-19 20:54:44 +00:00
README.md feat: improved storybook demos 2020-01-13 13:58:03 +01:00
test-helpers.js fix: public test-helpers 2019-07-30 15:50:53 +02:00

Localize

The localization system helps to manage localization data split into locales and automate its loading.

Live Demo/Documentation

See our storybook for a live demo and documentation

How to use

Installation

npm i --save @lion/localize
import { localize } from '@lion/localize';

Example

Translation data:

// path/to/hello-world/translations/en-GB.js
export default { greeting: 'Hello {name}!', };`

Loading translations:

// path/to/hello-world/HelloWorld.js
localize.loadNamespace({
  'hello-world': locale => {
    return import(`./translations/${locale}.js`);
  },
});

Translating messages:

localize.msg('hello-world:greeting', { name: 'John' });
// Hello John!