Download the PHP package phyconlabs/laravel-languages without Composer
On this page you can find all versions of the php package phyconlabs/laravel-languages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phyconlabs/laravel-languages
More information about phyconlabs/laravel-languages
Files in phyconlabs/laravel-languages
Package laravel-languages
Short Description String translations for Laravel
License MIT
Homepage https://github.com/PhyconLabs/laravel-i18n
Informations about the package laravel-languages
laravel-languages
This package combines functionality from Waavi/translation and thiagocordeiro/laravel-translator.
Installation
-
Require through composer
-
Publish vendor assets and configuration file
- Replace Laravel default Translation service provider in
config/app.php
with:
-
Migrate the translation and locale tables
- Include
/resources/js/translations.js
in your admin section/layout.
Configuration
- Set
available_locales
in/config/translator.php
- Set
layout
for translations UI to extend in/config/translator.php
- Insert available locales in
translator_languages
table
Usage
Routes
In your web.php
route file add locale
middleware for routes that need multilingual content and locale in the url
Scan project files for translation strings
Use artisan command php artisan translator:update
. This scans the app
and views
directories for usages of __( 'text' )
function and populates the translator_translations
table.
Manage translations
String translations can be edited at /translations
route, any changes are saved on field focusOut event.