- Update typescript definition for onMissingTranslationFunction function
- Update typescript definition for localizeReducer function
- ensure that store from props is initialized with initialize from props. #136
- adds to withLocalize HOC automatic hoisting to non react statics using hoist-non-react-statics #130
- Remove remaining references to redux in source #129
- Add initialize prop to LocaizeProvider to support SSR #127
- Fix too eager templater reg exp #118
- Handle falsy values in data. #117
- Add
getStateprop toLocalizeProviderto allow for ImmutableJS support #112
- Fix issue where bad
getOptionsselector was causing unnecessary re-renders #111
- Fix issue with onMissingTranslation not handling defaultTranslation properly #110
- Fix bad import in TypeScript definition #106
- Fix issue where onMissingTranslation would through error when defaultLanguage is not set #101
- Allow React components as dynamic data arguments #100
- Ensure that addDefaultTranslation gets called #99
- Update the TypeScript definition for withLocalize #98
- Make performance imporvements to
getTranslationsForLanguageandgetSingleToMultilanguageTranslationmethod. #92
- Add ignoreTranslateChildren to initialize options. #91
- Fix issue where Warning: Cannot update during an existing state transition message was appearing #88
- remove
console.loginLocalizeProvider
- Update package.json peerDependencies react version to 16.3.0 as the
Translatecomponent requires getDerivedStateFromProps.
- Now works without Redux by defualt.
- Add LoclaizeProvider a wrapper around React's Context.Provider
- Add LocalizeContext built on React.createContext.
- Add withLocalize higher-order component
- Add onMissingTranslation initialize option that provides more control over handling missing translations.
- Optionally supports Redux by passing redux store to
LocalizeProvider.
-
The Redux action creators
initialize,addTranslation,addTranslationForLanguage, andsetActiveLanguagehave been removed. Instead they are now methods available on LocalizeContext, and can be added to your component's as props using the withLocalize higher-order component. -
The
translationTransformoption is no longer available as an initialize option. Instead addTranslation now takes an options object, which accepts thetranslationTransformfunction.- This made more sense as this allows for adding transformations specific to a single translation instead of globally setting a transformation that you'd be stuck using for all translations.
-
initialize now takes a single options argument instead of multiple arguments.
-
Translate render props API now takes a single options object as an argument instead of multiple arguments.
-
renderInnerHtmloption now set tofalseby default instead oftrue.- This is to mirror React's functionality where by default any children will be escaped by defualt.
-
Remove
showMissingTranslationMsg,missingTranslationMsg,missingTranslationCallbackinitialize options. THe newonMissingTranslationoption now covers all these scenarios. -
Remove
setTranslationsaction - instead passlanguagesto initialize. -
Remove
localizehigher-order component - use newwithLoclizehigher-order component instead. Or if you only require access totranslatefunction use<Translate>component instead. -
If using Redux, all state related to localize will be added under the
localizekey instead oflocale. -
If using Redux,
localeReduceris now namedlocalizeReducer. -
Fix typos in
ADD_TRANSLATION_FOR_LANGUAGEaction (Issue #65)