Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "[Plugin: Polylang] Strings translations are lost after restore"

$
0
0

Hum...

The only way I see to try to solve your issue is to debug it:

Can you edit wp-config.php and replace:
define('WP_DEBUG', false);
by

define('WP_DEBUG', true);
define('SCRIPT_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

then edit polylang/include.mo.php near line 57 and replace:

public function import_from_db($lang) {
	if (!empty($lang->mo_id)) {
		$post = get_post($lang->mo_id, OBJECT);
		$strings = unserialize($post->post_content);
		if (is_array($strings)) {
			foreach ($strings as $msg)
				$this->add_entry($this->make_entry($msg[0], $msg[1]));
		}
	}
}

by

public function import_from_db($lang) {
	error_log(print_r($lang, true));
	if (!empty($lang->mo_id)) {
		$post = get_post($lang->mo_id, OBJECT);
		error_log(var_export($post, true));
		$strings = unserialize($post->post_content);
		error_log(print_r($strings, true));
		if (is_array($strings)) {
			foreach ($strings as $msg)
				$this->add_entry($this->make_entry($msg[0], $msg[1]));
		}
	}
}

then visit *one* time the strings translation panel.
This will create a file wp-content/debug.log
This may produce a quite big output if you have a lot of translations so please don't paste the content here but give me a link (you can use pastebin for example).


Viewing all articles
Browse latest Browse all 11471

Trending Articles