- 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
getState
prop toLocalizeProvider
to allow for ImmutableJS support #112
- Fix issue where bad
getOptions
selector 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
getTranslationsForLanguage
andgetSingleToMultilanguageTranslation
method. #92
- Add ignoreTranslateChildren to initialize options. #91
- Fix issue where Warning: Cannot update during an existing state transition message was appearing #88
- remove
console.log
inLocalizeProvider
- Update package.json peerDependencies react version to 16.3.0 as the
Translate
component 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
, andsetActiveLanguage
have 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
translationTransform
option is no longer available as an initialize option. Instead addTranslation now takes an options object, which accepts thetranslationTransform
function.- 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.
-
renderInnerHtml
option now set tofalse
by default instead oftrue
.- This is to mirror React's functionality where by default any children will be escaped by defualt.
-
Remove
showMissingTranslationMsg
,missingTranslationMsg
,missingTranslationCallback
initialize options. THe newonMissingTranslation
option now covers all these scenarios. -
Remove
setTranslations
action - instead passlanguages
to initialize. -
Remove
localize
higher-order component - use newwithLoclize
higher-order component instead. Or if you only require access totranslate
function use<Translate>
component instead. -
If using Redux, all state related to localize will be added under the
localize
key instead oflocale
. -
If using Redux,
localeReducer
is now namedlocalizeReducer
. -
Fix typos in
ADD_TRANSLATION_FOR_LANGUAGE
action (Issue #65)