Skip to content

Support nested JSON locale data

Latest
Compare
Choose a tag to compare
@pret-a-porter pret-a-porter released this 12 May 10:15
· 305 commits to master since this release

This release supports nested JSON locale data. Here is example:

const locales: ILocale[] = [
  {
    language: 'en',
    messages: {
      page1: {
        hello: 'Hello world!',
      },
      page2: {
        hello: 'Hello eo-locale!',
      },
    },
  },
];

const translator = new Translator('en', locales);
translator.translate('page1.hello'); // Hello world!