!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/kkomelin/laravel-translatable-string-exporter/src/Console/   drwxr-xr-x
Free 13.07 GB of 57.97 GB (22.54%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     InspectTranslationsCommand.php (2.82 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace KKomelin\TranslatableStringExporter\Console;

use 
Illuminate\Console\Command;
use 
Illuminate\Support\Str;
use 
KKomelin\TranslatableStringExporter\Core\Exporter;
use 
KKomelin\TranslatableStringExporter\Core\UntranslatedStringFinder;
use 
Symfony\Component\Console\Input\InputArgument;

class 
InspectTranslationsCommand extends Command
{
    
/**
     * The name and signature of the console command.
     *
     * @var string
     */
    
protected $signature 'translatable:inspect-translations {lang} {--export-first}';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Scan a language file for unstranslated string and display them in the console.';

    
/**
     * ExtractCommand constructor.
     *
     * @param  \KKomelin\TranslatableStringExporter\Core\Exporter  $exporter
     * @param  \KKomelin\TranslatableStringExporter\Core\UntranslatedStringFinder  $finder
     * @return void
     */
    
public function __construct(protected Exporter $exporter, protected UntranslatedStringFinder $finder)
    {
        
parent::__construct();
    }

    
/**
     * Execute the console command.
     *
     * @return int
     */
    
public function handle()
    {
        
$language $this->argument('lang');

        
$export_first $this->option('export-first');

        if (
$export_first) {
            
$this->exporter->export($language);
            
$this->info('Translatable strings have been extracted and written to the ' $language '.json file.');
        }

        
// Find untranslated strings in the given language file.
        
$untranslated_strings $this->finder->find($language);

        if (
$untranslated_strings === false) {
            
$this->info('Did not find ' $language '.json file. Use --export-first option.');

            return static::
FAILURE;
        }

        if (empty(
$untranslated_strings)) {
            
$this->info('Did not find any untranslated strings in the ' $language '.json file.');

            return static::
FAILURE;
        }

        
$count_untranslated count($untranslated_strings);

        
// Display untranslated strings.
        
$this->info(
            
'Found ' $count_untranslated ' untranslated ' .
                
Str::plural('string'$count_untranslated) . ' in the ' .
                
$language '.json file:'
        
);

        foreach (
$untranslated_strings as $untranslated_string) {
            
$this->info($untranslated_string);
        }

        return static::
SUCCESS;
    }

    
/**
     * Get the console command arguments.
     *
     * @return array
     */
    
protected function getArguments()
    {
        return [
            [
                
'lang',
                
InputArgument::REQUIRED,
                
'A language code for which untranslated strings are detected, e.g. "es".',
            ],
        ];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0056 ]--