An open API service indexing awesome lists of open source software.

https://github.com/koji/react-i18n-template

i18n template for react app
https://github.com/koji/react-i18n-template

i18n i18n-react react typescript

Last synced: 2 months ago
JSON representation

i18n template for react app

Awesome Lists containing this project

README

          

# React i18n Template

This is a template for a React application with i18n (internationalization) support.

## Technologies Used

* React
* Vite
* TypeScript
* i18next
* i18next-browser-languagedetector
* lucide-react
* styled-components
* tailwindcss
* eslint
* vitest

## Supported Languages

* English (en)
* Spanish (es)
* Chinese (zh)
* Korean (ko)
* Arabic (ar)
* French (fr)
* Japanese (ja)

![Image](https://github.com/user-attachments/assets/020087e2-5931-4ee1-898e-361359128fe4)
![Image](https://github.com/user-attachments/assets/5721397f-87e3-4c76-8b24-128b72b6e52b)
![Image](https://github.com/user-attachments/assets/a3ff0afb-d51f-46a0-ae8e-fa34e640239b)

## Scripts

* `dev`: Runs the development server using Vite.
* `build`: Builds the application for production.
* `lint`: Lints the code using ESLint.
* `preview`: Previews the built application.
* `test`: Runs the tests using Vitest.
* `test:coverage`: Runs the tests with coverage using Vitest.

## How to Run

1. Install dependencies:

```bash
pnpm install
```
2. Run the development server:

```bash
pnpm run dev
```

## Configuration

The i18n configuration is located in `src/i18n/config.ts`. It uses `i18next` and `i18next-browser-languagedetector` to handle translations and language detection.

Translations are located in `src/i18n/locales` in JSON format.

## License

This project is licensed under the MIT License - see the `LICENSE` file for details.