Download the PHP package atpro/translator without Composer
On this page you can find all versions of the php package atpro/translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atpro/translator
More information about atpro/translator
Files in atpro/translator
Package translator
Short Description Atpro translator allows you to translate lang files into several languages and thus save time in managing the internationalization of your laravel projects
License MIT
Informations about the package translator
atpro-translator laravel Package
Introduction
Atpro-translator is a package that allows you to easily manage the internationalization in your applications.
Installation
To get started with Atpro-translator, use Composer to add the package to your project's dependencies:
Configuration
After installing the Atpro-translator
library, register the \Atpro\Translator\AtproServiceProvider::class
in your config/app.php
configuration file:
Also, register the middleware in web middleware groups by simply adding the middleware class :
into the $middlewareGroups
of your app/Http/Kernel.php
file.
And then run :
publish AtproServiceProvider
.
Usage
To translate your lang files into other languages:
Run the command in terminal
Example:
- php artisan atpro:translate and click enter
- --> Your started language ?
en
- --> Your translated list language seperated with commas (,) example: fr,es ... ?
fr,it,es
- Click enter and wait for translated files
It will generate translated files in respective folder fr,it,es
OPTIONAL OPTIONS:
Options | Description | Examples |
---|---|---|
--e |
Generate files for all languages without any | php artisan atpro:translate --e='user.php,test.php' |
--f |
Generate files for specific path | php artisan atpro:translate --f='user.php,test.php' |
B. To generate views for translation:
Run the command in terminal
Example:
- php artisan atpro:generate-view-translate and click enter
- --> Yours languages seperated with commas (,) example: fr,es ... ?
fr,it,es
- Click enter and wait for generate views translate
It will generate a middleware, in controller, a routes file and a component containing the different options according to the chosen languages
You will also have a new component <x-atpro::language> </x-atpro::language>
. You can use it in views.
Note: Make sure that the started language folder exists in your language folder and contains files you want to translate.