netcore / module-translate
Installs: 2 505
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 4
Type:module
Requires
- netcore/translations: ~1.0.50
- predis/predis: ^1.1
README
Module allows you to manage available languages in page and manage translations for them.
Pre-installation
This package is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:
https://github.com/netcore/netcore
https://github.com/netcore/module-admin
Installation
Require this package with composer:
composer require netcore/module-translate
Publish config, assets, migrations. Migrate and seed:
php artisan module:publish-config Translate
php artisan module:publish Translate
php artisan module:publish-migration Translate
php artisan migrate
php artisan module:seed Translate
Usage
- To show your translated strings in page you should use "lg" function like this
lg('group.key', 'Lorem ipsum')
- or if you want to use replaceable attributes in translated string
lg('group.key', ['attribute' => 'value'], null, 'Lorem ipsum :attribute')
- and if you want to use this function in blade files, just add @, for example:
@lg('group.key', 'Lorem ipsum')
Finding translations
- This command will find all translations in project which uses "lg" function and create Excel sheet with keys and values(in available languages) in resources/seed_translations folder with the name specified in config (default: translations)
php artisan translations:find
Importing translations
- This command will import translations located in Excel sheet to database
php artisan translations:import
More info about core package can be found in (https://github.com/netcore/translations)