react-multilang-translate

0.2.11 • Public • Published

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)

/react-multilang-translate/

    Package Sidebar

    Install

    npm i react-multilang-translate

    Weekly Downloads

    0

    Version

    0.2.11

    License

    MIT

    Unpacked Size

    123 kB

    Total Files

    20

    Last publish

    Collaborators

    • jangbongki