HEX
Server: nginx/1.28.1
System: Linux iZgw8b5bpgd4jyptfmmmxgZ 6.6.102-5.2.alnx4.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 27 23:11:10 CST 2025 x86_64
User: www (1000)
PHP: 8.2.28
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.scdc-marine.com/wp-content/plugins/Polylang-Pro/modules/po/po-import.php
<?php
/**
 * @package Polylang-Pro
 */

/**
 * PO file, generated from importing translations
 *
 * Handles the reading of a PO file.
 *
 * @since 2.7
 */
class PLL_PO_Import implements PLL_Import_File_Interface {

	/**
	 * Po object.
	 *
	 * @var PO
	 */
	private $po;

	/**
	 * Constructor.
	 *
	 * Creates a PO object from an imported file.
	 *
	 * @since 2.7
	 */
	public function __construct() {
		require_once ABSPATH . '/wp-includes/pomo/po.php';
		$this->po = new PO();
	}

	/**
	 * Import the translations from a file.
	 *
	 * Relies on {@see PO::import_from_file()}
	 *
	 * @since 2.7
	 *
	 * @param string $filepath The path on the filesystem where the import file is located.
	 * @return WP_Error|true
	 */
	public function import_from_file( $filepath ) {
		// PO::import_from_file returns false in case it does not succeed to parse the file.
		if ( ! $this->po->import_from_file( $filepath ) ) {
			return new WP_Error( 'pll_import_wrong_po', esc_html__( 'Error: Invalid file.', 'polylang-pro' ) );
		}
		return true;
	}

	/**
	 * Get the source language
	 *
	 * @since 2.7
	 * @since 3.1 Renamed from PLL_PO_Import::get_source_lang()
	 *
	 * @return string|false
	 */
	public function get_source_language() {
		if ( ! empty( $this->po->headers['Language-Source'] ) ) {
			return $this->po->headers['Language-Source'];
		}
		return false;
	}

	/**
	 * Get the target language
	 *
	 * @since 2.7
	 *
	 * @return string|false
	 */
	public function get_target_language() {
		if ( ! empty( $this->po->headers['Language-Target'] ) ) {
			return $this->po->headers['Language-Target'];
		}
		return false;
	}

	/**
	 * Get the site reference.
	 *
	 * @since 2.7
	 *
	 * @return string|false
	 */
	public function get_site_reference() {
		if ( ! empty( $this->po->headers['Site-Reference'] ) ) {
			return $this->po->headers['Site-Reference'];
		}
		return false;
	}

	/**
	 * Get the next string translation to import.
	 *
	 * @since 2.7
	 *
	 * @return array
	 */
	public function get_next_entry() {
		return array(
			'id'   => null,
			'type' => PLL_Import_Export::STRINGS_TRANSLATIONS,
			'data' => $this->po,
		);
	}

}