inspirapuntodo/easy-locale-for-laravel

Easily manage your localization in your laravel app
6,684
Install
composer require inspirapuntodo/easy-locale-for-laravel
Latest Version:0.2.1
PHP:^8.1.0
License:MIT
Last Updated:Sep 11, 2024
Links: GitHub  ·  Packagist
Maintainer: inspirapuntodo

Easy Locale for Laravel

Easy Locale for Laravel is a package intended to make working with localization easier.

Installation

Here's how you track your website with Easy Locale for Laravel:

Requires PHP 8.1+

First, install Easy Locale for Laravel via the Composer package manager:

composer require inspirapuntodo/easy-locale-for-laravel

Next, add the following to config/app.php according to your locales, ex:

/*
|--------------------------------------------------------------------------
| Available locales
|--------------------------------------------------------------------------
|
| All locales supported by your application
| Format:
| - locale_key => locale_name
*/
'available_locales' => [
    'es' => 'Español',
    'en' => 'English',
]

Usage

Create transation files for each locale

php artisan locale:make {locale_path}

Example:

php artisan locale:make locations.cities
Expected output:
Creating localization files for: locations/cities

CREATED 🌎🌍🌏 es/locations/cities 🎉

CREATED 🌎🌍🌏 en/locations/cities 🎉

Hasta luego! 👋

Find differences on existing translation files

php artisan locale:diff
Output on SUCCESS
No differences found in your translation files
Output on FAILURE
Translation for key: orders.status.pending_oayment MISSING on locale ES

You have missing 1 translation\s

TODO

  • Find empty translation keys
  • Find diff on translation definitions, Ex: parameter :name set in spanish, but not in english
  • Find unused translations

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Contributors

Cesar Mendez (@Activ3mined)


Easy Locale for Laravel is an open-sourced software licensed under the MIT license.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

391,429,217 4,660

Version History

Version Released PHP License
0.2.1 ^8.1.0 MIT
0.2.0 ^8.1.0 MIT
0.1.1 ^8.1.0 MIT
0.1.0 ^8.1.0 MIT