PHP code example of syntaxas / laravel-lang-checker

1. Go to this page and download the library: Download syntaxas/laravel-lang-checker 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/ */

    

syntaxas / laravel-lang-checker example snippets


return [
    'welcome' => 'Welcome',
    'goodbye' => 'Goodbye', // present in EN
];

return [
    'welcome' => 'Sveiki',
    // 'goodbye' is missing
];

return [
    'nav' => [
        'home'  => 'Home',
        'about' => 'About',
    ],
];

return [
    'nav' => 'Navigacija', // scalar instead of array
];

return [
    'welcome' => '', // empty string
];

return [
    'welcome' => 'Welcome',
    'goodbye' => 'Goodbye',
];

return [
    'welcome' => 'Sveiki',
    'goodbye' => 'Viso gero',
];
bash
php artisan laravel-language:check

[ERROR] LT locale missing goodbye translation in messages.php

[ERROR] Missing file for locale LT: auth.php

[ERROR] Type mismatch for key nav in messages.php (EN=array, LT=value)

[WARNING] Empty translation in messages.php (EN): welcome