Skip to content

allnightru/laravel-translate-excel

Repository files navigation

Convert translations to/from a single Excel file

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package converts all PHP translations from Laravel`s "lang" directory a single Excel file with dot-arrayed keys. Each file comes to a separate sheet.

Installation

You can install the package via composer:

composer require insnsk/laravel-translate-excel

You can publish the config file with:

php artisan vendor:publish --tag="laravel-translate-excel-config"

This is the contents of the published config file:

return [
    // this is the default locale which will be used as reference
    'main_locale' => 'en',
    // what locations would you like to have in your file
    'locales' => ['en','de','ru','ja']
];

Usage

Just invoke the artisan console command:

php artisan lang:convert

And get your generated file at 'storage/app/translations.xlsx' You can specify filename as a parameter:

php artisan lang:convert to my_filename.xlsx

After you translate the file in Excel you would probably need to get it back to your app. So put your translated file "my_filename.xlsx" into "storage/app" directory, then run:

php artisan lang:convert from my_filename.xlsx

PHP-translation files will be generated into "storage/lang" folder. Just copy them back to your app root.

Changelog

Readme update & config publish

Security Vulnerabilities

This package was made just for my needs, so it was not tested at all and the code is not perfect also. Use it at your own risk.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages