javaabu / laravel-dhivehi-translate
Tr
Requires
- php: ^7.2 || ^8.0
- atran/translate: ^8.0
- illuminate/support: ^5.6|^6.0|^7.0|^8.0|^9.0
- tanmuhittin/laravel-google-translate: ~2.1
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.0
README
Translates Laravel language files to Dhivehi
Installation
You can install the package via composer:
composer require javaabu/laravel-dhivehi-translate
Laravel 5.5 and above uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.
After updating composer, add the ServiceProvider to the providers array in config/app.php
Javaabu\LaravelDhivehiTranslate\LaravelDhivehiTranslateServiceProvider::class,
Publish config files
This package essentially creates a Microsoft Translator driver for tanmuhittin/laravel-google-translate package using the InputOutputZ/ATran package.
So this package will publish modified versions of config files from those packages named atran.php
and laravel_google_translate.php
.
php artisan vendor:publish --force --provider="Javaabu\LaravelDhivehiTranslate\LaravelDhivehiTranslateServiceProvider"
Add Microsoft Azure Translation API Key to .env
AZURETRAN_KEY=xxxxxxxxxxxxxx
Follow this link to get API key.
Usage
Then you can run
php artisan translate:files
See it on action:
Str facade api-translation helpers
This package provides two translation methods for Laravel helper Str
Illuminate\Support\Str::apiTranslate
-> Translates texts using your selected api in configIlluminate\Support\Str::apiTranslateWithAttributes
-> Again translates texts using your selected api in config in addition to that this function respects Laravel translation text attributes like :name
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email info@javaabu.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.