PHP code example of zeerats / laravel-lang-lint

1. Go to this page and download the library: Download zeerats/laravel-lang-lint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

zeerats / laravel-lang-lint example snippets


return [
    // Directories scanned for translation calls, relative to the base path.
    'paths' => ['app', 'resources/views'],

    // Functions, static calls and Blade directives whose first argument is a key.
    'functions' => ['__', 'trans', 'trans_choice', '@lang', '@choice', 'Lang::get', 'Lang::has', 'Lang::choice'],

    // Locales to check. Empty: every directory in the language path except vendor.
    'locales' => [],

    // Regular expressions for locale directories to skip during discovery.
    'ignore_locales' => [],

    // Regular expressions for keys that count as used without a literal call.
    'assume_used' => ['/^auth\./', '/^pagination\./', '/^passwords\./', '/^validation\./'],
];
bash
php artisan vendor:publish --tag=lang-lint-config
bash
php artisan lang:check
php artisan lang:check --show-locations
php artisan lang:check --locale=de --path=app/Http
bash
php artisan lang:unused
php artisan lang:unused --prune
yaml
translations:
  script:
    - php artisan lang:check
    - php artisan lang:format --check