Skip to content

Releases: daniloster/react-i18n-base

Fixed publication

03 Oct 15:38

Choose a tag to compare

Added .npmignore to avoid the adoption of .gitignore, when .npmignore is not present.

Added component to consume internationalised content

16 Jul 10:11

Choose a tag to compare

Changes

  • Added I18nTranslate component as a property of localised components
  • Added mutation-helper as a dependency
  • Updated docs

Updated dev-dependency with vunerability

22 Jun 17:21

Choose a tag to compare

Changes

It does not affect consumers.

Updated docs and references

02 Apr 07:36

Choose a tag to compare

Changes

  • Added home page link to package.json
  • Added github url to package.json
  • Added author to package.json
  • Added reference to Home Page in the README.md

Using features from React 18.4.0

31 Mar 15:26

Choose a tag to compare

Description

There was an API change reasoning the breaking change.

Changes

  • I18nProvider
    • Removed property locales from provided
    • Renamed property defaultLocale to defaultLanguage
    • Renamed property locale to initialLanguage
    • Renamed property onChangeI18n to onChangeLanguage
  • Added methods to localised components
    • extend and factory
    • extend: change globally the localisation json data for a specific component
    • factory: creates new localised component with extension of localisation json data

Example

import { localise } from 'react-i18n-base';

const Greeting = ({ name, i18n }) => (<div>{i18n.greeting} {name}!</div>);
const jsonData = {
  en: { greeting: 'Mr/Mrs' }
};
const LocalisedGreeting = localise(jsonData)(Greeting);
LocalisedGreeting.extend({
   pt: { greeting: 'Sr/Sra' }
});
// The code above extend the localisation to all`LocalisedGreeting` instances
const NewSupportLocalisedGreeting = LocalisedGreeting.factory({
  es: { greeting: 'Sr/Sra' }
});

Note: After factoring, the LocalisedGreeting still have support to 2 languages (en, pt) whereas NewSupportLocalisedGreeting have support to 3 languages (en, pt, es)

[Corrupted]

31 Mar 15:11

Choose a tag to compare

v2.0.0

[skip ci] v2.0.0