react-multilang-translate

Module that provides an easy way to translate into your preferred language in React.

Usage no npm install needed!

<script type="module">
  import reactMultilangTranslate from 'https://cdn.skypack.dev/react-multilang-translate';
</script>

README

react-multilang-translate

GitHub license

Features

  • Translate with message object
  • Mutiline translate
  • Implementation with React
  • Usage with Redux is recommended
  • Decorate the style with props.

Installation

yarn add react-multilang-translate

or

npm install --save react-multilang-translate

Import

// at the top of your app
import { Translator } from "react-multilang-translate"

Usage

//message.js
export const MESSAGE = {
    en_US : {
        example_say_hello : 'Hello'
    },
    ko_KR : {
        example_say_hello : '안녕하세요'
    }
}
import React, { Component } from 'react';
import { Translator } from 'react-multilang-translate';
import { MESSAGE } from './message';

class Example extends Component {
  render() {
    return (
      <Translator
        transKey='example_say_hello'
        locale='en_US'
        messageObj={MESSAGE}
      />
    );
  }
}

Example

git clone https://github.com/BKJang/react-multilang-translate.git
cd react-multilang-translate/example
npm install
npm start

Copyright and License

MIT License

Copyright (c) 2019 BKJang(PaulJ)