Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-content
/
plugins
/
loco-translate
/
src
/
admin
/
File Content:
SyncOptions.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
config
---
0755
list
---
0755
AjaxRouter.php
6839 bytes
0644
DownloadConfController.php
945 bytes
0644
JsonSerializable.php
577 bytes
0644
Project.php
25730 bytes
0644
Revisions.php
6508 bytes
0644
SyncOptions.php
2310 bytes
0644
class-sitemaps-admin.php
3665 bytes
0644
class-wpseo-statistics-20260705060524.php
1443 bytes
0644
class-wpseo-statistics.php
1443 bytes
0644
dashboard-1650-rtl.css
1634 bytes
0644
deactivation.php
21118 bytes
0644
duplicator-main-20260707001922.php
26907 bytes
0644
duplicator-main.php
26907 bytes
0644
duplicator.php
1781 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500-20260706214316.php
48544 bytes
0644
elFinderVolumeLocalFileSystem.class-20260623050500.php
48544 bytes
0644
exceptions.php
708 bytes
0644
image-helper.php
10231 bytes
0644
loco.php
5626 bytes
0644
manager-20260705065820.php
14659 bytes
0644
manager.php
14659 bytes
0644
meta-fields-presenter.php
1600 bytes
0644
recovery.php
1146 bytes
0644
root.php
1951 bytes
0644
uninstall.php
4401 bytes
0644
wordpress-seojs-ar-20260708002531.json
25925 bytes
0644
wordpress-seojs-ar.json
25925 bytes
0644
wordpress-seojs-fi.json
19387 bytes
0644
N4ST4R_ID | Naxtarrr