Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 28 replies, has 3 voices.

Last updated by Andreas W. 10 months, 1 week ago.

Assigned support staff: Andreas W..

Author Posts
October 1, 2019 at 6:16 pm #4674597

mennoB-4

Hi,
Please It's possible to reopen this ticket?
The ticket is not resolved
https://wpml.org/forums/topic/img-link/page/4/#post-4670657

thanks

October 2, 2019 at 12:02 am #4675737

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for letting me know.

I made myself a picture of the issue and the translation seems not to work. I am consulting the compatibility team about the encoded links and I am asking for a suitable solution.

I will be in contact once I received feedback.

Kind regards
Andreas

October 2, 2019 at 10:47 pm #4683415

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Our compatibility team advised the following:

You can decode the link (eg http%3A%2F%2Flight-ox.w5.wpsandbox.pro%2F2017%2F03%2F09%2Fhello-world%2F) using this

hidden link

This will give you
hidden link

Then you can add the /en/ language directory part to be
hidden link

hidden link

Then encode it and it gives you

http%3A%2F%2Flight-ox.w5.wpsandbox.pro%2Fen%2F2017%2F03%2F09%2Fhello-world%2F

You can use the encoded link in the final format:

url:http%3A%2F%2Flight-ox.w5.wpsandbox.pro%2F2017%2F03%2F09%2Fhello-world%2F|title:Hello%20world!|target:%20_blank|

Let me know if this is a suitable solution for you or if you need anz assistance with applying the link translations.

Kind regards
Andreas

October 3, 2019 at 1:39 pm #4688097

mennoB-4

Hi, Thanks for your msg

Before updating the translation the page in English the design was good but the links did not work. After updating the page it looks bad as before.

For encode is not working or I can't Understand how it's works.
Anyway I did manually because Is not difficult.

...is not working.

------

link
hidden link

example 01:

nl
url:https%3A%2F%2Fnlinfo-yumungori.savviihq.com%2Fmarine%2Foffshore-weather%2F|title:Shipping%20%26%20Terminals||

en
url:https%3A%2F%2Fnlinfo-yumungori.savviihq.com%2Fen%2Fmarine%2Foffshore-weather%2F|title:Shipping%20%26%20Terminals||

October 3, 2019 at 10:24 pm #4691609

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Sadly, I can not obtain access to your server.

I am not sure why it is not working. Can you please confirm if the following code was pasted correctly in the theme´s functions.php file?

add_filter( 'wpml_pb_shortcode_encode', 'wpml_pb_shortcode_encode_urlencoded_json', 10, 3 );
function wpml_pb_shortcode_encode_urlencoded_json( $string, $encoding, $original_string ) {
	if ( 'base64_json' === $encoding ) {
		$output = array();
		foreach ( $original_string as $combined_key => $value ) {
			$parts = explode( '_', $combined_key );
			$i = array_pop( $parts );
			$key = implode( '_', $parts );
			$output[ $i ][ $key ] = $value;
		}
		$string = base64_encode( json_encode( $output ) );
	}
	return $string;
}

add_filter( 'wpml_pb_shortcode_decode', 'wpml_pb_shortcode_decode_urlencoded_json', 10, 3 );
function wpml_pb_shortcode_decode_urlencoded_json( $string, $encoding, $original_string ) {
	if ( 'base64_json' === $encoding ) {
		$original_string = base64_decode($original_string);
		$rows = json_decode( $original_string , true );
		$string = array();
		foreach ( $rows as $i => $row ) {
			foreach ( $row as $key => $value ) {
				if ( in_array( $key, array( 'single_link','text', 'title', 'features', 'substring', 'btn_text', 'label', 'value', 'y_values' ) ) ) {
					
					$string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => true );
				} else {
					$string[ $key . '_' . $i ] = array( 'value' => $value, 'translate' => false );
				}
			}
		}
	}
	return $string;
}

I am following up with our compatibility team. Let me know if everything was fine with the code.

I also have already twice recreated the issue on a WP sandbox, but sadly those installs are expired now. Could I please ask you again to install the theme and its plugins on the following test site?

One-Click Login: hidden link

Kind regards
Andreas

October 4, 2019 at 9:21 am #4694415

mennoB-4

yes the code is there
Sorry, I don't have time to copy the theme

October 4, 2019 at 5:05 pm #4697657

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I just realized that your site is still using old version of our plugins.

Could you please complete the available updates seen on Dashboard -> Updates and let me know if the issue persists?

You can also find the updates at Plugins -> Add new -> Commercial -> Search for WPML updates.

In the meantime, I am testing the issue again on a test site and I will be in contact in regards to my results soon.

Kind regards
Andreas

October 4, 2019 at 8:05 pm #4698427

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Additional to my last email, I would like to add that I recreated the Uncode/ WP Bakery Media Gallery on a new install with our latest plugin versions.

The Single Block links are not showing up on the WPML Translation Editor, but there was not an issue about editing these links manually, using the native WordPress Page Editor for each page in its respective language.

You can see this here on the page "WPML Gallery Test":
One-Click Login:hidden link

I then added the earlier mentioned code to the theme's functions.php file and added the XML config to WPML -> Settings -> Custom XML Config. Afterward, I had to edit and save the page elements again in order for the WPML Translation Editor to register the changes.

The links are not getting translated. I am really sorry for not verifying this earlier. I am following up with the compatibility team about the issue.

For now, please remove the code from the functions.php and the custom xml config inside of the WPML settings. You should be able to translate the links manually in the meantime, as explained above.

Let me know if you do have any questions.

Kind regards
Andreas

October 7, 2019 at 7:15 am #4704929

mennoB-4

Thanks for your msg
I found an alternative solution to solve this problem.
I duplicated the site on my server so you can do tests. (Staging environment website )
I can send you the information in a private message?

October 7, 2019 at 2:57 pm #4708701

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for your message.

Please provide me detailed steps for the workaround that you found and send me the credentials to the staging within the next private reply.

Kind regards
Andreas

October 8, 2019 at 8:32 am #4713169

mennoB-4

hi,
the pictures are missing, in the stagging website, the hosting support is working on.
I need to create a new stagging site, please send me the option for a private msg again.
thanks

October 8, 2019 at 2:02 pm #4716249

mennoB-4

Hi,
At the same time I made a new test with the pots module ( similar to the image m.) , and the links are working.

hidden link

October 9, 2019 at 1:21 am #4718515

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for the updates. I am Marcos and I am replacing my colleague Andreas here, you will be able to provide the staging website access in a private reply now. Please, let me know if you need any other detail, have a nice day.

October 9, 2019 at 3:39 pm #4724109

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

The password for the staging is sadly not working anymore.

Do I understand right, that after recreating a new page the link translation worked now?

Kind regards
Andreas

October 10, 2019 at 11:27 am #4729753

mennoB-4

Hi,

I tested, and is working fine

It's working the link translation in the home page, but the element is different is not an "image gallery" is a "post-page gallery".

**CREDENTIALS REMOVED**