language-support-easy
v0.0.14
Published
`language-support-easy` is a devtool for making multilingual changes easy in your React application. It supports TypeScript and integrates seamlessly with i18n.
Downloads
8
Readme
language-support-easy
language-support-easy
is a devtool for making multilingual changes easy in your React application. It supports TypeScript and integrates seamlessly with i18n.
Installation
You can install the package using npm or yarn:
npm install language-support-easy
OR
yarn add language-support-easy
Section 3: Usage
Usage
Import Devtool
from language-support-easy
and use it in your application. Make sure to pass your i18n instance as a prop.
import { Devtool } from "language-support-easy";
import "language-support-easy/dist/style.css";
// if you are using React with i18n proper setup than you have to use like this
<Devtool i18n={i18n} />;
// if you are not using i18n proper setup than you have to use like this
<Devtool
isI18nSetup={false}
provideFiles={{
en: //Your Language file json,
fr: //Your Language file json,
// other
}}
/>;
Section 4: Props
Props
i18n
- Type:
Object
- Description: The i18n instance for your application.
Example
Here is an example of how to use Devtool
in a React application:
import React from "react";
import ReactDOM from "react-dom";
import { Devtool } from "language-support-easy";
import i18n from "./i18n"; // Assuming you have set up i18n in your project
const App = () => (
<div>
<h1>Hello, World!</h1>
<Devtool i18n={i18n} />
</div>
);
ReactDOM.render(<App />, document.getElementById("root"));