Download the PHP package joeri-abbo/laravel-easy-translations without Composer
On this page you can find all versions of the php package joeri-abbo/laravel-easy-translations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joeri-abbo/laravel-easy-translations
More information about joeri-abbo/laravel-easy-translations
Files in joeri-abbo/laravel-easy-translations
Package laravel-easy-translations
Short Description Laravel laravel-easy-translations support
License
Informations about the package laravel-easy-translations
Laravel Easy Translations
Getting Started
Prerequisites
- Php 8 and up
- Laravel 9
Installation
To get started require the package with composer.
After installing the package in to your laravel project run the command below to add the config and create the language folder.
You can custom the dir for the language file storage by editing the config setting storage_path to your wanted path. After changing this setting the dir automatically will be generated when a transulation is called. You can also force it by running
Usage
You can easily use the translate function in your application. The first parameter is required the second one is your language pack. Default it uses your default set in the config. If you do not change this it will be english.
If you want to translate to your custom language pack it is as easy as adding the second parameter for the language pack like below
To change the default pack on your web pack it is as easy to change the value inside the Language helper class like below. The translated sting will be in the set language pack. If it is not found it will return the given string.
You can translate the json file by your editor but there is also a view for this. To access this view your application
env needs to be value APP_ENV needs to be local.
The url is base_url/laravel-easy-translations
this view shows the found languages and the option to edit these translations.
You can also automatic translate your application by using the command below. It wil use Google translate to translate your given base language pack
Releases
version 1.0.0
- Initial release