Project Structure
Translation Source File
The source translation file uses the honyaku.dev format withtext and description fields. The description provides context for the AI translator to produce more accurate translations.
messages/en.json
Honyaku Message Converter
Since next-intl expects simplestring values, we need to convert the honyaku.dev format (with text and description fields) into plain strings. loadMessages extracts the text from each entry, and loadLocale handles loading the right file for each locale.
lib/honyaku.ts
i18n Setup
Routing
Defines the supported locales from@honyaku-dev/locales (which provides metadata for 100+ languages) and sets English as the default.
i18n/routing.ts
Request Configuration
Loads the appropriate translation file for each request. English messages are always spread as a fallback, so any missing translations in other languages will gracefully fall back to English.i18n/request.ts
GitHub Actions Workflow
This workflow automatically translates the source file into all supported languages whenevermessages/en.json is updated on the main branch. The targets: "all:{id}.json" pattern generates a separate file for each language.
.github/workflows/translate.yml