Skip to content

Interface shortcuts and maintenance

Compare
Choose a tag to compare
@omrilotan omrilotan released this 10 Sep 07:54
· 50 commits to master since this release

Add default options

I18n instance can be created with no options

Bind translate

Binding the "translate" function allows for simpler shortcutting:

Consumer code

Before

const i18n = new I18n({...});
const t = i18n.translate.bind(i18n);

After

const i18n = new I18n({...});
const t = i18n.translate;
// OR
const t = new I18n({...}).translate;

Add alias t to 'translate' function


Maintenance work