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

Software: Apache. PHP/8.3.27 

uname -a: Linux pdx1-shared-a4-04 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64 

uid=6659440(dh_z2jmpm) gid=2086089(pg10499364) groups=2086089(pg10499364)  

Safe-mode: OFF (not secure)

/usr/local/wp/vendor/wp-cli/i18n-command/src/   drwxr-xr-x
Free 713.92 GB of 879.6 GB (81.16%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace WP_CLI\I18n;

use Gettext\Generators\Jed;
use Gettext\Translation;
use Gettext\Translations;

/**
 * Jed file generator.
 *
 * Adds some more meta data to JED translation files than the default generator.
 */
class JedGenerator extends Jed {
    /**
     * {@parentDoc}.
     */
    public static function toString( Translations $translations, array $options = [] ) {
        $options += static::$options;
        $domain   = $translations->getDomain() ?: 'messages';
        $messages = static::buildMessages( $translations );

        $configuration = [
            '' => [
                'domain'       => $domain,
                'lang'         => $translations->getLanguage() ?: 'en',
                'plural-forms' => $translations->getHeader( 'Plural-Forms' ) ?: 'nplurals=2; plural=(n != 1);',
            ],
        ];

        $data = [
            'translation-revision-date' => $translations->getHeader( 'PO-Revision-Date' ),
            'generator'                 => 'WP-CLI/' . WP_CLI_VERSION,
            'source'                    => $options['source'],
            'domain'                    => $domain,
            'locale_data'               => [
                $domain => $configuration + $messages,
            ],
        ];

        return json_encode( $data, $options['json'] );
    }

    /**
     * Generates an array with all translations.
     *
     * @param Translations $translations
     *
     * @return array
     */
    public static function buildMessages( Translations $translations ) {
        $plural_forms      = $translations->getPluralForms();
        $number_of_plurals = is_array( $plural_forms ) ? ( $plural_forms[0] - 1 ) : null;
        $messages          = [];
        $context_glue      = chr( 4 );

        foreach ( $translations as $translation ) {
            /** @var Translation $translation */

            if ( $translation->isDisabled() ) {
                continue;
            }

            $key = $translation->getOriginal();

            if ( $translation->hasContext() ) {
                $key = $translation->getContext() . $context_glue . $key;
            }

            if ( $translation->hasPluralTranslations( true ) ) {
                $message = $translation->getPluralTranslations( $number_of_plurals );
                array_unshift( $message, $translation->getTranslation() );
            } else {
                $message = [ $translation->getTranslation() ];
            }

            $messages[ $key ] = $message;
        }

        return $messages;
    }
}

:: 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.0599 ]--