Skip to content

Releases: ibitcy/eo-locale

Support nested JSON locale data

12 May 10:15
Compare
Choose a tag to compare

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!

Custom tagName property

09 Apr 14:22
Compare
Choose a tag to compare

Now you can provide property tagName in Text component.
It is very useful for increase SEO points. For example, in you translations you have some html like:

<li>one</li>
<li>two</li>

When text component render html it creates <span> wrapper by default. Now you can change to any html tag. Example with list:

<EOLocale.Text html id="SOME_KEY" tagName="ul" />

onIdMissing => onError

06 Jan 15:49
Compare
Choose a tag to compare

Property renaming onIdMissing => onError.
Use onError to handle any errors inside eo-locale

onIdMissing handler has been implemented

23 Dec 15:25
Compare
Choose a tag to compare

In some cases you want to find incorrect usage of translation keys. For example, you received error key from server response, and that key does not exist in current translations. You can log that kind of errors by onIdMissing handler.

Basic example:

const App: React.FC = () => {
  return (
    <EOLocaleProvider language="en" locales={[]} onIdMissing={id => {
      // do something
    }}>
      ...
    </EOLocaleProvider>
  )
}

Support of select token has been added

09 Apr 09:15
Compare
Choose a tag to compare

Behaviour of provider has been fixed

04 Apr 08:34
Compare
Choose a tag to compare

Flow types has been added

02 Apr 08:45
Compare
Choose a tag to compare

Flow types has been fixed

02 Apr 10:04
Compare
Choose a tag to compare
v.6.2.4

v6.2.4