laravel-google-translate maintained by neoteknic
Last update
2022/02/16 11:51
License
Require
- illuminate/console >=5.1
- php >=8.0.0
- illuminate/support ^8|^9
- illuminate/translation ^8|^9
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2022/02/16 11:51
License
Require
- illuminate/console >=5.1
- php >=8.0.0
- illuminate/support ^8|^9
- illuminate/translation ^8|^9
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2022/02/16 11:45
License
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8|^9
- illuminate/translation ^5.5|^6|^7|^8|^9
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2022/02/16 11:38
License
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8|^9
- illuminate/translation ^5.5|^6|^7|^8|^9
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2022/02/10 14:50
License
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8|^9
- illuminate/translation ^5.5|^6|^7|^8|^9
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2021/09/08 01:57
License
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8
- illuminate/translation ^5.5|^6|^7|^8
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2021/09/08 01:56
License
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8
- illuminate/translation ^5.5|^6|^7|^8
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2020/09/30 20:04
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8
- illuminate/translation ^5.5|^6|^7|^8
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2020/09/09 10:00
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7|^8
- illuminate/translation ^5.5|^6|^7|^8
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2020/08/24 15:42
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7
- illuminate/translation ^5.5|^6|^7
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2020/06/26 15:58
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7
- illuminate/translation ^5.5|^6|^7
- stichoza/google-translate-php ^4.0
- google/cloud-translate ^1.7.4
- yandex/translate-api ^1.5.2
- ext-json *
Last update
2020/06/26 15:19
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7
- illuminate/translation ^5.5|^6|^7
- stichoza/google-translate-php ^4.0
- google/cloud-translate dev-master
- yandex/translate-api dev-master
- ext-json *
Last update
2020/03/04 19:54
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6|^7
- illuminate/translation ^5.5|^6|^7
- stichoza/google-translate-php ^4.0
Last update
2019/10/02 08:32
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6
- illuminate/translation ^5.5|^6
- stichoza/google-translate-php ^4.0
Last update
2019/09/07 21:26
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support ^5.5|^6
- illuminate/translation ^5.5|^6
- stichoza/google-translate-php ^4.0
Last update
2019/06/14 00:15
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php ^4.0
Last update
2019/05/23 20:40
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php ^4.0
Last update
2019/05/23 20:40
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php ^4.0
Last update
2019/04/03 10:43
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php 4.0.0
Last update
2019/04/02 15:58
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php dev-master
Last update
2019/03/29 22:06
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php dev-master
Last update
2019/03/29 15:29
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php dev-master
Last update
2019/03/29 14:35
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php dev-master
Last update
2019/03/29 13:28
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
- stichoza/google-translate-php dev-master
Last update
2019/03/29 13:17
Require
- illuminate/console >=5.1
- php >=7.0.0
- illuminate/support 5.5.x|5.6.x|5.7.x|5.8.x
- illuminate/translation 5.5.x|5.6.x|5.7.x|5.8.x
Last update
2019/03/28 08:01
Require
- illuminate/console >=5.1
- php >=7.0.0
Last update
2019/03/27 15:57
Require
- illuminate/console >=5.1
- php >=7.0.0
Last update
2019/03/07 14:46
Require
- illuminate/console >=5.1
- php >=7.0.0
Last update
2018/12/11 08:17
Require
- illuminate/console >=5.1
- php >=7.0.0
laravel-google-translate
- Translate translation files (under /resources/lang) or lang.json files
- Provide extra facade functions Str::apiTranslate and Str::apiTranslateWithAttributes
by using stichoza/google-translate-php or Google Translate API https://cloud.google.com/translate/ or Yandex Translatin API https://tech.yandex.com/translate/
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
how to use your own translation api
- Create your own translation api class by implementing Tanmuhittin\LaravelGoogleTranslate\Contracts\ApiTranslatorContract
- Write your classname in config laravel_google_translate.custom_api_translator . Example : Myclass::class
- Write your custom apikey for your custom class in laravel_google_translate.custom_api_translator_key
Now all translations will use your custom api.
installation
composer require tanmuhittin/laravel-google-translate
php artisan vendor:publish --provider="Tanmuhittin\LaravelGoogleTranslate\LaravelGoogleTranslateServiceProvider"
If you would like to use stichoza/google-translate-php you do not need an API key. If you would like to use Google Translate API, edit config/laravel_google_translate.php and add your Google Translate API key.
php artisan config:cache
Then you can run
php artisan translate:files
See it on action:
potential issues
SSL certificate problem: unable to get local issuer certificate
https://stackoverflow.com/a/31830614
suggested packages
This package can be used with https://github.com/andrey-helldar/laravel-lang-publisher.
- Add base Laravel translation files using https://github.com/andrey-helldar/laravel-lang-publisher
- Translate your custom files using this package
Done
finally
Thank you for using laravel-google-translate :)