- Translate with message object
- Mutiline translate
- Implementation with React
- Usage with Redux is recommended
- Decorate the style with props.
yarn add react-multilang-translate
or
npm install --save react-multilang-translate
// at the top of your app
import { Translator } from "react-multilang-translate"
//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}
/>
);
}
}
git clone https://github.com/BKJang/react-multilang-translate.git
cd react-multilang-translate/example
npm install
npm start
MIT License
Copyright (c) 2019 BKJang(PaulJ)