Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
loco-translate
/
src
/
compat
/
File Content:
SyncOptions-20260623074658.php
<?php /** * Abstracts PO sync options held in custom headers */ class Loco_gettext_SyncOptions { /** * @var LocoPoHeaders */ private $head; public function __construct( LocoPoHeaders $head ){ $this->head = $head; } /** * Test if PO file has alternative template path * @return bool */ public function hasTemplate(){ return '' !== $this->head->trimmed('X-Loco-Template'); } /** * Get *relative* path to alternative template path. * @return Loco_fs_LocaleFile */ public function getTemplate(){ return new Loco_fs_LocaleFile( $this->head['X-Loco-Template'] ); } /** * Set *relative* path to alternative template path. * @param string */ public function setTemplate( $path ){ $this->head['X-Loco-Template'] = (string) $path; } /** * Test if translations (msgstr fields) are to be merged. * * @return bool */ public function mergeMsgstr(){ return 0 === preg_match( '/\\bpot\\b/', $this->getSyncMode() ); } /** * Test if JSON files are to be merged. * @return bool */ public function mergeJson(){ return 1 === preg_match( '/\\bjson\\b/', $this->getSyncMode() ); } /** * @return string */ public function getSyncMode(){ $mode = strtolower( $this->head->trimmed('X-Loco-Template-Mode') ); // Default sync mode when undefined is to honour the type of source. // i.e. for legacy compatibility, copy msgstr fields if source is a PO file. if( '' === $mode ){ $mode = $this->hasTemplate() ? strtolower( $this->getTemplate()->extension() ) : 'pot'; } return $mode; } /** * @param string */ public function setSyncMode( $mode ){ $this->head['X-Loco-Template-Mode'] = (string) $mode; } /** * Remove redundant headers * @return LocoPoHeaders */ public function getHeaders(){ if( ! $this->hasTemplate() ){ $this->head->offsetUnset('X-Loco-Template'); if( 'pot' === $this->getSyncMode() ){ $this->head->offsetUnset('X-Loco-Template-Mode'); } } return $this->head; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
CtypeExtension.php
391 bytes
0644
Failure.php
940 bytes
0644
JsonSerializable.php
577 bytes
0644
SyncOptions-20260623074658.php
2310 bytes
0644
SyncOptions.php
2310 bytes
0644
TokenizerExtension.php
551 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
class-yoast-notification-center.php
23601 bytes
0644
deactivation.php
21118 bytes
0644
duplicator-20260704004435.php
1781 bytes
0644
elFinderPlugin.php
3331 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260706024429.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260706180215.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class.php
48544 bytes
0644
exceptions.php
708 bytes
0644
loco.php
5626 bytes
0644
manager-20260707054758.php
14659 bytes
0644
manager.php
14659 bytes
0644
module.php
1297 bytes
0644
request-methods-header.php
1127 bytes
0644
setup.php
2699 bytes
0644
N4ST4R_ID | Naxtarrr