This project is a small Vite + React + react-i18next example that shows how a product can ship multilingual UI with JSON translation files and a language switcher.
The app itself is intentionally simple. The real goal is to show a clean translation workflow for React teams, and how that workflow can be connected to Yesglot.
Most React i18n demos stop at "here is how to call t('hello')".
This repo goes one step further:
- It shows how to structure a React app with
i18next. - It keeps translations in normal JSON files that your app can load at runtime.
- It demonstrates how a tool like Yesglot can keep those translation files updated as your product changes.
In short: this is not just a translation demo, it is a translation workflow demo.
Yesglot is an AI-first translation workflow tool for software teams.
At a high level, you connect your repository, add a yesglot.toml config file, point it to your source and target translation files, and Yesglot helps generate and maintain translations for the languages you support.
For React apps using react-i18next, that usually means:
- your source language lives in a file like
public/locales/en/translation.json - your target languages live in files like
public/locales/es/translation.json - Yesglot watches the source file for changes
- when new text is added, it opens a pull request with updated target translation files
That means your team can review translation changes in GitHub the same way you review code changes.
- You connect your GitHub repository to Yesglot.
- You add a
yesglot.tomlfile to the root of the repo. - You tell Yesglot which file is the source language and which files are the target languages.
- You update the source translation file when your app text changes.
- Yesglot detects the change and creates a pull request with translated files.
- Your team reviews and merges the PR.
That is the core idea: source strings in your repo, translated output in PRs, and humans still stay in control.
- Node.js 18+ recommended
- npm
npm installnpm run devThen open the local URL printed by Vite, usually:
http://localhost:5173
npm run buildnpm run previewsrc/i18n.jssets upi18next, browser language detection, and JSON loading frompublic/locales/{{lng}}/translation.json.src/PizzaJustifier.jsxrenders the UI and language dropdown.public/locales/en/translation.jsonis the source translation file for English.public/locales/<language>/translation.jsonis where translated files live for other languages.i18next.config.jsis used byi18next-cliwhen generating and syncing locale files.
This repo already uses react-i18next, so the integration is mostly about connecting your translation files to Yesglot.
Keep one source language file and one file per target language.
Example:
public/
locales/
en/
translation.json
tr/
translation.json
fr/
translation.json
In this example app, English is the source language.
If you want i18next-cli to create the target language files for you, first make sure the locales array in i18next.config.js contains the languages you want, then run:
npx i18next-cli syncThis command reads your source strings, creates any missing public/locales/<language>/translation.json files, and syncs keys across the configured languages.
Set up i18next so your app loads translations from those files.
This repo already does that in src/i18n.js:
backend: {
loadPath: "/locales/{{lng}}/translation.json",
}That means:
enloads frompublic/locales/en/translation.jsonesloads frompublic/locales/es/translation.jsonfrloads frompublic/locales/fr/translation.json
After creating your project in Yesglot, it will connect the GitHub repository and commit the yesglot.toml file.
Once connected, Yesglot can watch the branch you configured in tracked_branch.
When you add or change product copy, update the source file first:
{
"title": "Pizza Justifier",
"subtitle": "Enter your circumstances. Receive your verdict."
}Then commit and push that change.
When Yesglot sees changes in the source translation file, it can generate the corresponding target-language updates and open a pull request with those file changes.
Your workflow becomes:
- Add or update English strings.
- Push to your tracked branch.
- Review the Yesglot translation PR.
- Merge it when the translations look good.
If your product uses special terminology, you can guide translations with custom_prompt and per-language glossaries.
Example:
[project]
id = "proj_your_project_id"
technology = "react-i18next"
custom_prompt = "This is a playful consumer app. Keep the tone light and natural."
[glossary.tr]
"Pizza Justifier" = "Pizza Justifier"
"Verdict" = "Hukum"This is useful when you want brand names, legal wording, or product terms to stay consistent.
If you want the simplest setup, use this order:
- Build your app with
react-i18next. - Keep English as the source of truth.
- Store translations in
public/locales/<lang>/translation.json. - Add
yesglot.toml. - Let Yesglot create PRs for translation updates.
- Review translations before merging.
That keeps your localization process close to your normal Git workflow and avoids managing translations in a separate spreadsheet or ad hoc copy-paste process.
This README is based on:
- the live Yesglot homepage: yesglot.com
- the public Yesglot config specification: github.com/yesglot/yesglot.toml