This package includes:
- translation strings (in json format) for Jetstream auth view and components
- translation template file (in json format) for Jetstream auth view and components (useful for who wants starting to translate strings in a new language)
- command for extracting translation strings from view templates (Blade files)
You can install the package via composer:
composer require hi-folks/jet-translations
php artisan vendor:publish --provider="HiFolks\JetTranslations\JetTranslationsServiceProvider" --tag="lang" --force
Install this package in your Laravel Jetstream application and enable a language in your config/app.php via locale configuration:
// config/app.php file
'locale' => 'it',
Json files is located in this package in the directory:
- resources/lang/lang.json
Currently, just italian language is supported.
If you don't find translations in your native language, you could contribute to Jetstream, translating strings in your native language.
To help you I created a "template" json file to start the translation process. You can find resources/lang/template-lang.json with all untranslated strings. My suggestion is to copy this file in _resource/lang/xy.lang, where xy is the code of your language (de, en, fr, etc...).
The JetTranslations package is shipped with an artisan command:
php artisan jet-trans:extract
This command:
- it parses all blade files in vendor/laravel/jetstream/stubs/livewire/resources/views
- it extracts strings defined in __("");
- it checks if there is some missing keys in ./resources/lang/vendor/jet-translations/it.json (ot the json of the specified language via --language option)
This command could save the json file using --save-json options. For example using:
php artisan jet-trans:extract --language=de --save-json
It saves de.json file in resources/lang/vendor/jet-translations/ directory of your Laravel app.
Laravel Jetstream includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management. With Livewire, Jetstream provides Blade templates with Translation Strings. Blade templates provided by Jetstream are ready to be translated, they use the __() helper :
__("Dashboard");
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.