Skip to content

t1sh0o/laravel-translatable-string-exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translatable String Exporter for Laravel >= 5.4

As we know, Laravel 5.4 has introduced a "new" way of string translation. Now you can use __('Translate me') or @lang('Translate me') with translations in JSON files to translate strings. Translatable String Exporter is aimed to collect all translatable strings of an application and create corresponding translation files in JSON format to simplify the process of translation.

Installation

  1. Add kkomelin/laravel-translatable-string-exporter to your project:
composer require kkomelin/laravel-translatable-string-exporter
  1. For Laravel >= 5.5 we use Package Auto-Discovery, so you may skip this step. For Laravel < 5.5, add ExporterServiceProvider to the providers array in config/app.php:
KKomelin\TranslatableStringExporter\Providers\ExporterServiceProvider::class,

Configuration

To change project defaults, use the following command to create a configuration file in your config folder and make necessary changes in there:

php artisan vendor:publish --provider="KKomelin\TranslatableStringExporter\Providers\ExporterServiceProvider"

Usage

php artisan translatable:export <lang>

Where <lang> is a language code, for example "es". You can also provide multiple languages to export to at once, separating their codes with comas "es,en,bg".

The command with the "es" parameter will create es.json file in the resources/lang folder of your project.

License & Copyright

MIT, (c) 2018 Konstantin Komelin

About

Translatable String Exporter for Laravel >= 5.4

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%