smousss/laravel-globalize
| Install | |
|---|---|
composer require smousss/laravel-globalize |
|
| Latest Version: | 0.1.5 |
| PHP: | ^8.1 |
| Laravel: | 9 · 10 |
| License: | MIT |
| Last Updated: | Apr 24, 2023 |
| Links: | GitHub · Packagist |

Make entire Laravel projects translatable
Wrapping up every translatable piece of text in every view of an existing Laravel project inside the __() helper is a time-consuming and boring assignment. Luckily, artificial intelligence is perfectly suited for repetitive actions.
-<h2>Create a new post</h2>
+<h2>{{ __('Create a new post') }}</h2>
…
-<footer>© {{ config('app.name') }} {{ date('Y') }}. All rights reserved.</footer>
+<footer>{{ __('© :name :date. All rights reserved.', [
+ 'name' => config('app.name'),
+ 'date' => date('Y'),
+]) }}</footer>
Installation
Install the package via Composer:
composer require smousss/laravel-globalize
Publish the config file:
php artisan vendor:publish --tag=globalize-config
Usage
First, generate a secret key on smousss.com.
Then, add it to your SMOUSSS_SECRET_KEY environment variable.
Finally, internationalize your views:
php artisan smousss:globalize
Globalize will ask you if you want to process all your views or a selection of them.
Should Globalize process a particular file or everything? [Choose files]:
[0] Choose files
[1] Process everything!
Credits
Globalize for Laravel has been developed by Benjamin Crozat for Smousss (Twitter).
License
Related Packages
Self-hosted Laravel translation manager for the TALL stack: edit, sync, import/e...
Languara localization plugin for Laravel 4.x. Easily upload, translate, and sync...
Languara localization plugin for Laravel 5.x. Easily upload, translate, and sync...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.1.5 | ^8.1 | ^9.0| | MIT | |
| 0.1.4 | ^8.1 | ^9.0| | MIT | |
| 0.1.3 | ^8.1 | ^9.0| | MIT | |
| 0.1.2 | ^8.1 | ^9.0| | MIT | |
| 0.1.1 | ^8.1 | ^9.0| | MIT | |
| 0.1.0 | ^8.1 | ^9.0| | MIT |