#The Problem
Inertia.js applications have a split architecture:
- Backend (Rails): Uses YAML locale files (
config/locales/*.yml) - Frontend (React/Svelte/Vue): Uses i18next JSON files
This creates several challenges:
- Duplicate management: Maintaining translations in two formats
- Sync issues: Keys in YAML but missing in JSON (or vice versa)
- No usage tracking: Unused translation keys accumulate
- Manual process: Converting YAML → JSON by hand is error-prone
Existing tools like i18n-tasks only handle Rails/backend translations.
#The Solution
InertiaI18n provides:
- YAML → JSON conversion with interpolation mapping (
%{var}→{{var}}) - AST-based scanning to find translation usage in
.svelte,.tsx,.vuefiles - Health checks to detect missing, unused, and unsynchronized keys
- Watch mode for automatic regeneration during development
- Rails integration via initializers and rake tasks
One source of truth: Rails YAML files, with JSON auto-generated.