Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filipponik/translate-analyzer
Translating keys analyzer package (now works with laravel-style translations)
https://github.com/filipponik/translate-analyzer
composer laravel package php translate translation translator
Last synced: about 15 hours ago
JSON representation
Translating keys analyzer package (now works with laravel-style translations)
- Host: GitHub
- URL: https://github.com/filipponik/translate-analyzer
- Owner: Filipponik
- Created: 2022-12-08T10:07:23.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-05-26T09:45:06.000Z (over 1 year ago)
- Last Synced: 2024-12-09T22:47:39.081Z (28 days ago)
- Topics: composer, laravel, package, php, translate, translation, translator
- Language: PHP
- Homepage: https://packagist.org/packages/filipponik/translate-analyzer
- Size: 26.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Translate analyzer
## Installing
```shell
composer require filipponik/translate-analyzer --dev
```## Usage
1. Use `pwd` to get needed directory, or use `__DIR__` in code.
```
$ pwd
/home/user/project
```2. Set your directory path, analyze some folder recursively and create language files.
```php
$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');
```