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. This utility recursively walks the message tree and extracts the text from each leaf node.
lib/honyaku.ts
i18n Setup
Routing
Defines the supported locales fromlocale.json (which contains metadata for 100+ languages) and sets English as the default.
i18n/routing.ts
Request Configuration
Loads the appropriate translation file for each request. English is loaded from the source file, while other languages are loaded from themessages/generated/ directory. The raw honyaku.dev format is then converted to simple messages.
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