Background of the issue:
Hi, I've problem. I can't translate products because they have base64 encoded descriptions. The site I need help with is hidden link. The text on the page says that WPML cannot send part of the content for translation because it contains fields that are encoded. Translators will not be able to work with this kind of content, so it has been removed from the job. To solve this problem, I need to inform WPML how these fields are encoded so that WPML can decode them before sending them for translation.
Symptoms:
WPML nie może przesłać części zawartości do tłumaczenia. Część zawartości, którą wybrano do tłumaczenia zawiera pola, które są kodowane. Tłumacze nie będą w stanie pracować z tego rodzaju zawartością, a zatem usunęliśmy ją ze zlecenia.
Questions:
Any ideas on how to change or dismiss base64 encoded descriptions?
Jak wskazać WPML, że ma dekodować pola?
Welcome to the WPML support forum. Thanks for contacting us.
While waiting for one of my colleagues to help with this ticket, I had asimilar case this week where the issue was coming from custom fields from a previous theme.
Here is the ticket: https://wpml.org/fr/forums/topic/https-hoo-talk-com/
- Go to "WPML > Settings > Custom fields translation"
- Check the box "Show "Multilingual Content Setup" meta box on post edit screen."
- Go back to edit the original page in the WordPress editor.
- At the bottom you will have a new section that will show you all custom fields used on that page and review those custom fields.
In short:
- Go to "WPML > Support > Debug Information" (link)
- Copy the Debug Information from there.
- Find the private field I activated and paste that information.
Hello there! Hi Nicolas.
It is not it.
The problem is the names of images that are saved in WP as base64 binary code. Is it possible to exclude the translation of image descriptions and names, or make WPML not translate this type of data?
There is also an option at the bottom of the settings - Media translation. But when I deselect it, it remains selected anyway. Maybe there's a way around it...
Thank You.
Is this what it's supposed to look like?
<?php
use WPML\FP\Str;
class WPML_Encoding_Validation {
const MINIMUM_STRING_LENGTH = 100;
/**
* Checks if data passed is base64 encoded string and if the length of it is more than or equal to $minimumValidStringLength.
* Here we check for the length because we had cases were featured image names are passed in a false positive base64 encoding format.,
* and this made the whole job to be blocked from sending to translation, while if a real field is encoded the length of it should be way more than how the image name will be.
*
* @param string $string
*
* @seehidden link
* @seehidden link
*/
/**
* public function is_base64_with_100_chars_or_more( $string ) {
if ( (bool) preg_match( '/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $string ) === false ) {
return false;
}