This project uses @nuxtjs/i18n with lazy-loaded locale files in i18n/locales and Crowdin for translation management.
- Strategy:
prefix_except_default - Default locale:
en - Enabled locales:
en,es,fr,de,nb,vi - Blog is intentionally excluded from localized route generation via
defineI18nRoute(false)in:app/pages/blog/index.vueapp/pages/blog/[...slug].vue
- Source locale file:
i18n/locales/en.json - Target locale files:
i18n/locales/es.jsoni18n/locales/fr.jsoni18n/locales/de.jsoni18n/locales/nb.jsoni18n/locales/vi.json
- Create a Crowdin project.
- If you want to run Crowdin CLI commands locally, configure these environment variables:
CROWDIN_PROJECT_IDCROWDIN_PERSONAL_TOKEN
- Use the scripts below for manual local sync.
npm run i18n:crowdin:upload
npm run i18n:crowdin:download
npm run i18n:crowdin:syncUse this to verify Nuxt i18n loading and locale switching without Crowdin CLI credentials.
- Add a visible marker in one locale file (example in
i18n/locales/es.json):"common": { "language": "Idioma (localhost-test)" }
- Run the app:
npm run dev
- Open a page with the language switcher and enable probe mode:
http://localhost:3000/?i18nTest=1http://localhost:3000/es?i18nTest=1
- Confirm:
/shows English probe text (Language)/esshows Spanish probe text (Idioma (localhost-test))- Changing the language in the switcher updates both URL prefix and probe text.
This repository uses Crowdin's native GitHub integration (configured in Crowdin UI), not a GitHub Actions sync workflow.
Recommended Crowdin integration settings:
- Integration target: this repository's default branch (
main) - Source file:
i18n/locales/en.json - Translation files:
i18n/locales/%two_letters_code%.json - Export pattern: keep locale JSON files in the same folder structure
- PR updates: enabled (Crowdin creates PRs with translated locale changes)
Important:
- Do not enable a second automated sync path in GitHub Actions for Crowdin, or you may get duplicate PRs/commits.
- Keep
.crowdin.ymlin the repo because Crowdin uses it for file mapping.