We often start a small project and eventually it grows bigger. And before handover clients want a last tiny-miny changes like language support. 😐
You have used proper format when using strings {{ __('Your String In Blade File') }}
but now you have to browse 100 of files and extract list them to create language files.
Well... It happened to me and tried to minimize the effort a little bit and though to share this with others.
- You have a project with lots of blade files.
- You have used ___() underscores function for printing strings.
- Now you need to add translation support and you are lazy to browse all files and collect the strings.
- Clone the repo
- Install the dependencies
- Copy all view files and folder/s from your laravel project to php folder
- run
python extract.py
- You will get all your strings to
strings.blade.php
You should use underscores function properly in laravel {{ __('Your String In Blade File') }}
otherwise it can not extract the strings