Download the PHP package inweb/translations-parser without Composer
On this page you can find all versions of the php package inweb/translations-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inweb/translations-parser
More information about inweb/translations-parser
Files in inweb/translations-parser
Package translations-parser
Short Description Parse files and pull translatable phrases
License MIT
Homepage https://github.com/inwebcomp/translations-parser
Informations about the package translations-parser
Parse your files and pull translatable phrases.
Requirements
- PHP >= 7.1
Installation
You can install the package via composer:
Give access to you ./lang folder
Add facade to your config/app.php file
Configuration
Run to publish translations-parser.php configuration file
There you can change locales and folders that are used by artisan command
Sometimes you receive your locales list during the application run. You can just overwrite this setting in your code:
Usage
Artisan commands
Parse translations with artisan command
Force parse translations. Old translations will be removed
Methods
Get phrases from string
Get phrases from files in directories
Can exclude directories or files from list
Get phrases in {locale}.json file
Save phrases to .json file
By default, phrases would not be overwritten It will be overwritten only if there is no phrase in your .json file, or phrase translation is empty
Set last parameter to true to force writing in .json. You will lose old data
Save one phrase translation
Testing
Credits
License
The MIT License (MIT). Please see License File for more information.