| name | type-bridge-translation-generation |
| description | Generates TypeScript/JavaScript/JSON translation files from Laravel lang files using the type-bridge:translations command. Use when user says "sync translations to frontend", "generate JS translations", or needs Laravel translation strings available in Vue/JavaScript. |
Laravel Type Bridge - Translation Generation
When to use this skill
Use this skill when you need to:
- Generate frontend translation files from Laravel lang files
- Convert PHP translation arrays to TypeScript, JavaScript, or JSON
- Set up i18n libraries with Laravel translations
Overview
This package generates frontend translation files from Laravel's lang files. Check config/type-bridge.php for discovery paths and output settings.
Available Commands
php artisan type-bridge:translations en
php artisan type-bridge:translations en --format=json
php artisan type-bridge:translations en --format=js
php artisan type-bridge:translations en --format=ts
php artisan type-bridge:translations en --flat
Generate Everything Command
Generate enums, translations, and translators in one command:
php artisan type-bridge:generate
php artisan type-bridge:generate en
php artisan type-bridge:generate --enums=Status --enums=App\\Enums\\Role
php artisan type-bridge:generate --translations-format=json
i18n Library Support
The package supports two i18n libraries. Set the target library in config/type-bridge.php under i18n_library:
i18next - Works with i18next, react-i18next, Node.js projects
vue-i18n - Works with Vue.js projects using vue-i18n