vwinck-dev/laravel-translator

Translation files and localization utilities for Laravel.

Maintainers

Package info

github.com/vwinck-dev/laravel-translator

pkg:composer/vwinck-dev/laravel-translator

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v0.1.0 2026-05-08 16:00 UTC

This package is auto-updated.

Last update: 2026-05-08 19:53:23 UTC


README

Packagist Version Total Downloads License CI Status

Translation files and localization utilities for Laravel - publish, manage and extend your app's translations with a single Artisan command.

Features

  • Auto-discovery - zero configuration, works out of the box with Laravel's package system
  • Artisan integration - publish and update translations via lang:update
  • JSON-based - simple, human-readable translation files
  • Multi-locale - grow your supported languages incrementally
  • CI/CD ready - version-controlled translations that fit neatly into automated pipelines

Requirements

  • PHP 8.1+
  • Laravel ^10.x

Installation

composer require vwinck-dev/laravel-translator

The package registers itself automatically via Laravel's auto-discovery. No manual provider or alias registration needed.

Publishing Translations

To publish the translation files to your application's lang/ directory, run:

php artisan lang:update

Alternatively, use the standard Artisan vendor publish command:

php artisan vendor:publish --tag=translations

Available Locales

Locale Language Status
en English
pt_BR Portuguese (Brazil)

Want to add a new locale? See Contributing.

Project Structure

lang/
├── en.json       # English (base)
└── pt_BR.json    # Portuguese (Brazil)

Each file is a flat JSON map of the original string to its translation - compatible with Laravel's __() and trans() helpers out of the box.

Usage

Use Laravel's built-in translation helpers anywhere in your application:

// Blade
{{ __('Attach files by dragging & dropping, selecting or pasting them.') }}

// PHP
__('Attach files by dragging & dropping, selecting or pasting them.');

The corresponding pt_BR.json entry:

{
  "Attach files by dragging & dropping, selecting or pasting them.": "Anexe arquivos arrastando, selecionando ou colando."
}

Roadmap

  • Missing translation detection
  • Translation diff command
  • Vendor package translation support
  • Remote synchronization
  • Automatic merge support
  • Per-locale installer commands

Contributing

Contributions, issues, and feature requests are welcome!

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/your-locale
  3. Commit your changes: git commit -m 'feat: add fr locale'
  4. Push and open a Pull Request

Please follow the existing file naming conventions and ensure your JSON is valid before submitting.

License

Distributed under the MIT License. © vwinck-dev