https://github.com/professor-correa/i18next-js
Minimal React + Vite project demonstrating i18next internationalization with automatic language detection and GitHub Pages deployment.
https://github.com/professor-correa/i18next-js
i18n-react i18next vercel vite vitejs
Last synced: about 1 month ago
JSON representation
Minimal React + Vite project demonstrating i18next internationalization with automatic language detection and GitHub Pages deployment.
- Host: GitHub
- URL: https://github.com/professor-correa/i18next-js
- Owner: professor-correa
- Created: 2025-11-09T02:53:01.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-11T20:09:10.000Z (7 months ago)
- Last Synced: 2025-11-11T20:31:48.379Z (7 months ago)
- Topics: i18n-react, i18next, vercel, vite, vitejs
- Language: JavaScript
- Homepage: https://i18next-vite-js.vercel.app
- Size: 94.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# i18next-vite-js
A minimal project built with React and Vite that demonstrates how to use i18next for internationalization (i18n) with automatic language detection and GitHub Pages deployment.
## Features
- Built with React and Vite
- Multi-language support (English and Portuguese)
- Automatic language detection based on the browser
- Simple i18n setup using i18next-http-backend
- Automatic deployment using GitHub Actions and GitHub Pages
## Project Structure
```
i18next-vite-js/
├── public/
│ └── locales/
│ ├── en/
│ │ └── translation.json
│ └── pt/
│ └── translation.json
├── src/
│ ├── i18n.js
│ ├── App.jsx
│ └── main.jsx
├── vite.config.js
└── .github/
└── workflows/
└── deploy.yml
```
## How It Works
- The project loads translations from `/public/locales/{{lng}}/translation.json`.
- The browser language is detected automatically.
- The user can also change the language manually in the interface.
Example:
```jsx
changeLanguage("pt")}>pt
changeLanguage("en")}>en
```
## Commands
```bash
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
```
## Deployment
The project is automatically deployed to GitHub Pages using GitHub Actions.
Each push to the `main` branch triggers the build and publishes the site to:
```
https://professor-correa.github.io/i18next-vite-js/
```
## License
MIT License
Created by [Professor Corrêa](https://github.com/professor-correa)