Make your Redux React app multilingual

For my current React app in development I’m using Redux to manage the client state. As this is the first time using Redux I’m not quite sure what to put in the store yet. But I’ve decided to give the multilingual labels and wordings a try. Below you’ll find a simple approach on how I made my app multilingual using the Redux client state to store the translated content. I assume you are familiar with Redux and React.

The i18n state reducer contains all translation and puts the default language content into the store.


let phrases = {
  de: {
    button: {
      remove: 'Löschen',
      update: 'Speichern',
      commit: 'Neue Version',
      add_router: 'Router hinzufügen',
      search: 'Suche',
      cancel: 'Abrechen',
  en: {
    button: {
      remove: 'Delete',
      update: 'Save',
      commit: 'Commit',
      add_router: 'Add Router'

export default (state =, action) => {
  switch (action.type) {
      return phrases[action.language]
      return state

To get f.g. the translated button labels simply map the i18n state as prop on the component.


import React from 'react'
import { connect } from 'react-redux'

class RouterSearch extends React.Component {


  render() {
    let { i18n } = this.props

    return <Card>

        floatingLabelText={ }



const mapStateToProps = (state) => {
  return {
    i18n: state.i18n,
export default connect(mapStateToProps)(RouterSearch)

Switching the language is easily done by setting the language state.


export const switchLanguage = (language) => {
  return {
    type: 'SWITCH_LANGUAGE',

Obviously the are a lot cons to this method. First, there is no fallback for not translated content as you access to i18n state directly. Second, putting multilingual content into the store is probably not a good idea in the first place. What do you think? Are there better options?

3 Responses

  1. Hi! If interested in trying new l10n tools, you can make an app multilingual using this software localization management platform like that is based on collaborative work and is easy to use. It can save time with your localization projects.

Leave a Reply

Back to Top
%d bloggers like this: