Package Data | |
---|---|
Maintainer Username: | MFlor |
Maintainer Contact: | interactive@bonnier.dk (Bonnier Publications) |
Package Create Date: | 2017-09-07 |
Package Last Update: | 2022-04-26 |
Language: | PHP |
License: | Unknown |
Last Refreshed: | 2024-11-23 03:03:05 |
Package Statistics | |
---|---|
Total Downloads: | 141 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 11 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel package that retrieves translations strings from Translation Manager and makes them available for Laravel translation functions.
To use the translator call
Btrans::translate($key, $replace, $locale)
instead of
trans($key, $replace, $locale)
To add a translation, run:
php artisan bonnier:translation:add "translation-key" "Translation value"
To update an exisiting translations, run:
php artisan bonnier:translation:update "translation-key" "Translation value"
To delete an existing translation, run: VERY DESTRUCTIVE
php artisan bonnier:translation:delete "translation-key"
To get all translations from Translation Manager, run:
php artisan bonnier:translation:get
composer require bonnier/laravel-translation-provider
...
'providers' => [
...
Bonnier\TranslationProvider\TranslationServiceProvider::class,
],
.env
SERVICE_ID=1
TRANSLATIONMANAGER_URL=http://url-to-translationmanager.com
config/services.php
'translation_manager' => [
'url' => env('TRANSLATIONMANAGER_URL'),
'service_id' => env('SERVICE_ID'),
],
config/app.php
'aliases' => [
...,
'BTrans' => \Bonnier\TranslationProvider\Helpers\BTrans::class,
]