---
name: type-bridge-translation-generation-c8a120157a82
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

```bash
# Generate translations for a locale
php artisan type-bridge:translations en

# Generate translations as JSON
php artisan type-bridge:translations en --format=json

# Generate translations as JavaScript
php artisan type-bridge:translations en --format=js

# Generate translations as TypeScript
php artisan type-bridge:translations en --format=ts

# Generate "flat" translation keys instead of nested
php artisan type-bridge:translations en --flat
```

## Generate Everything Command

Generate enums, translations, and translators in one command:

```bash
# Generate all
php artisan type-bridge:generate

# Generate for specific locale
php artisan type-bridge:generate en

# Limit to specific enums
php artisan type-bridge:generate --enums=Status --enums=App\\Enums\\Role

# Use different format for translations
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


---
Source attribution: GaiaTools
Original project: https://github.com/GaiaTools/laravel-type-bridge/blob/2c5009cd927402f306463278f3224ea17c533f8c/resources/boost/skills/type-bridge-translation-generation/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 Gaia Tools

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: GaiaTools
Original project: https://github.com/GaiaTools/laravel-type-bridge/blob/2c5009cd927402f306463278f3224ea17c533f8c/resources/boost/skills/type-bridge-translation-generation/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Frontend Developer, Product Manager
Specialties: Backend, Frontend, React
Tools: Laravel
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 9c41e96a77f917e5474294add0b680eca5a8eee6217430396b0c4cf1f9134d99
