File manager - Edit - /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/gettext/gettext/src/Extractors/JsCode.php
Back
<?php namespace Gettext\Extractors; use Exception; use Gettext\Translations; use Gettext\Utils\FunctionsScanner; /** * Class to get gettext strings from javascript files. */ class JsCode extends Extractor implements ExtractorInterface, ExtractorMultiInterface { public static $options = [ 'constants' => [], 'functions' => [ 'gettext' => 'gettext', '__' => 'gettext', 'ngettext' => 'ngettext', 'n__' => 'ngettext', 'pgettext' => 'pgettext', 'p__' => 'pgettext', 'dgettext' => 'dgettext', 'd__' => 'dgettext', 'dngettext' => 'dngettext', 'dn__' => 'dngettext', 'dpgettext' => 'dpgettext', 'dp__' => 'dpgettext', 'npgettext' => 'npgettext', 'np__' => 'npgettext', 'dnpgettext' => 'dnpgettext', 'dnp__' => 'dnpgettext', 'noop' => 'noop', 'noop__' => 'noop', ], ]; protected static $functionsScannerClass = 'Gettext\Utils\JsFunctionsScanner'; /** * @inheritdoc * @throws Exception */ public static function fromString($string, Translations $translations, array $options = []) { static::fromStringMultiple($string, [$translations], $options); } /** * @inheritDoc * @throws Exception */ public static function fromStringMultiple($string, array $translations, array $options = []) { $options += static::$options; /** @var FunctionsScanner $functions */ $functions = new static::$functionsScannerClass($string); $functions->saveGettextFunctions($translations, $options); } /** * @inheritDoc * @throws Exception */ public static function fromFileMultiple($file, array $translations, array $options = []) { foreach (static::getFiles($file) as $file) { $options['file'] = $file; static::fromStringMultiple(static::readFile($file), $translations, $options); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings