Download the PHP package dlogon/translation-manager without Composer
On this page you can find all versions of the php package dlogon/translation-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dlogon/translation-manager
More information about dlogon/translation-manager
Files in dlogon/translation-manager
Package translation-manager
Short Description This is my package translation-manager
License MIT
Homepage https://github.com/dlogon/translation-manager
Informations about the package translation-manager
laravel Translation manager
Manage your translations in your laravel proyect with a web interface.
This package has been inspired by barryvdh/laravel-translation-manager
Installation
You can install the package via composer:
You can run the migrations and optional publish the migrations with:
You can publish the config file with:
Optionally, you can publish the views using
Usage
To access the web manager, access to the url "yourproject"/translations, if you want to change the route prefix of the manager, publish the config file (translation-manager.php) and change "prefix" inside the "route" array, therefore, if you are not using auth, comment the "auth" middleware inside the route array
This is that you will see when enter to the manager
When you add a new Lang, you'll see the lang in the bellow section (ADD NEW KEY) and in the table on the bottom
Then, you should add a group in the Groups tab, groups are intended to create diferent files if you work with the "php array" aproach, or for "enhance" the visual presentation if you use the "json" aproach.
Now, you can add a key, with a value for every lang that you have been created. when you press add, you will see the added key in the bottom table, if you do not see the key, ensure that you select the group where you store the key in the above dropdown.
if you want to change any translation, just click the translation and you will see an input to put the new translation, if you click the Ok button, you will see a notifications saying that the translation updated successfully
Model translations
Maybe you noticed the Model translations tab, here, you can generate a group for every model in your app, and this will generate a key for every column in you model.
For example, if we have a Post model, and we already run the migration with some columns.
If you want to avoid some columns, you can add it into the config file, there are a default ignored columns of the User model, and there are a default columns ignored from all models
Generating the translation files
Once you are ready and you have created your translations, is time to create the translations files, above all you will see the big orange button Generate translations, below you will see a radio where you can select the aproach.
If you select the php aproach, your translation files will have the structure
rootapp/<your lang folder>/<lang1>/
group1.php
group2.php
rootapp/<your lang folder>/<lang2>/
group1.php
group2.php
If you select the JSON aproach, you will see a property in your generated json, this property has the structure
"//GROUP<group-name>" = "///////////////GROUP-<group-name>/////////////////////"
for example:
en.json
es.json
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Diego
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
TODO
- Read and store lang files in database
- Filter keys
- Read lang and add to database on install package