Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable re-setting of fallback language and store it to redux state #93

Merged
merged 4 commits into from
Oct 1, 2018

Conversation

DimitrisD
Copy link
Contributor

So far, the package is a great solution to add internationalization using react-redux. The only part that i found it to be missing was the multiple fallback languages.

Why is this a need?

Let's say that in an app, somebody wants to support multiple languages, with multiple dialects, and they want to have different fallback language for each of the dialects.

Right now, the redux-i18n doesn't support it.

Adding the newFallbackLanguage to the redux state, the functionality above is being added.

Somebody can set their initial fallback language the way they could, but using the function:
setFallbackLanguage(newfallback) they can have multiple fallbacks.

Usage:

import {setLanguage, setFallbackLanguage} from "redux-i18n"

componentWillMount() {
  // set of a dialect language
  this.props.dispatch(setLanguage("es-ES"))
  // set specific fallback to that language fallback
  this.props.dispatch(setFallbackLanguage("es"))
}

@DimitrisD DimitrisD changed the title Enable re-setting of fallback language and store it to redux store as the language. Enable re-setting of fallback language and store it to redux state Sep 26, 2018
@francescarpi francescarpi merged commit 875e18a into APSL:master Oct 1, 2018
@francescarpi
Copy link
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants