next-google-translate-widget
Version:
A simple Next.js/React component for integrating Google Translate Widget with customizable language options.
48 lines (37 loc) โข 1.53 kB
Markdown
# Google Translate Widget for NextJS/React
A React/Next.js component to integrate Google Translate Widget easily.
## โจ Features
- โ
Simple integration with React and Next.js
- ๐ Supports multiple languages
- ๐ Uses Google Translate's official widget
- โก Automatically loads translation script
- ๐จ Customizable included languages
## โ ๏ธ Limitations
- ๐ท Displays Google Translate branding
- ๐ง Limited customization options due to Google Translate restrictions
## ๐ฆ Installation
```bash
npm install next-google-translate-widget
# or
yarn add next-google-translate-widget
```
## ๐ Usage/Examples
```tsx
"use client";
import GoogleTranslate from "next-google-translate-widget";
export default function App() {
return <GoogleTranslate pageLanguage="en" includedLanguages="hi,en" />;
}
```
## โ๏ธ Props
| Prop | Type | Default | Description |
| ------------------- | -------- | --------- | ------------------------------------- |
| `pageLanguage` | `string` | `"en"` | The main language of the page. |
| `includedLanguages` | `string` | `"hi,en"` | Comma-separated languages to include. |
## ๐ฅ Demo
[Live Demo](https://codesandbox.io/p/devbox/clhqy9)
## ๐ค Contributing
This package needs your contributions! Feel free to fork the repository and create a pull request. ๐
**Your contributions make this project better. Thank you for your support! โค๏ธ**
## ๐งพ License
[MIT](https://choosealicense.com/licenses/mit/)