filipponik / translate-analyzer
Translating keys analyzer package
v0.0.4
2023-05-26 09:42 UTC
Requires
- php: ^7.4|^8.0
- ext-mbstring: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- phpmd/phpmd: ^2.13
- symfony/var-dumper: ^6.1
This package is auto-updated.
Last update: 2024-11-26 12:50:43 UTC
README
Installing
composer require filipponik/translate-analyzer --dev
Usage
- Use
pwd
to get needed directory, or use__DIR__
in code.
$ pwd
/home/user/project
- Set your directory path, analyze some folder recursively and create language files.
$analyzer = new \Filipponik\TranslateAnalyzer\Analyzer(); $analyzer ->setDirectoryPath('/home/user/project') // Analyze only .php files ->setSuffix('php') // Analyze directory ../app ->analyze('app') // Write to laravel 8- file structure ->toLaravel8AndBefore(['en', 'es', 'ch']) // Write to laravel 9+ file structure ->toLaravel9AndAbove(['en', 'es', 'ch']) // Or write lang files to selected directory ->writeResultsToFiles('my_lang_files');