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 7 replies, has 2 voices.

Last updated by Carlos Rojas 8 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
November 11, 2019 at 3:01 pm #4925951

Martino

Old content is working fine but new content doesn't get the correct translation (or orginal content), just some random letter.

I used this code in function:
function custom_translate( $input ) {
$current_values = array( 'Addetti ai lavori', 'Coffee lover', 'Degustazione', 'Tecniche di produzione', 'Tecniche di preparazione', 'Analisi sensoriale', 'Dal verde alla tazza', 'Corso Sca' );
$replace_values = array( 'Professionals', 'Coffee Lovers', 'Tasting', 'Production tecniques', 'Preparation tecniques', 'Sensory analysis', 'From bean to cup', 'SCA Course' );
return str_replace( $current_values, $replace_values, $input );
}

and a simple "echo custom_translate( $target['label']" in the template.

November 12, 2019 at 11:42 am #4931337

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+02:00)

Hello,
Thank you for contacting WPML support.

I'm truly sorry but I don't understand the issue 🙁

Can you please elaborate a little more so I can better understand?

Kind regards,
Carlos

November 12, 2019 at 11:48 am #4931353

Martino

Hi Carlos!

I've a CPT. This CPT has some CF.
Some of these CF are radio buttons.
They are set as "copy" from the original language to the translated version.

Unfortunately the label is not rendered, it look like the translated contend doesn't "get" the CF data as array. This stopped working on recent WPML changes, because it was working for almost a year.

Now I managed to make it work again getting the original language ID and requesting the custom field for the origina version, but it's not nice at all.

November 12, 2019 at 11:51 am #4931377

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Was the original code created by you or by a theme/plugin?

Regards,
Carlos

November 12, 2019 at 11:54 am #4931391

Martino

By me with the help of Konrad Karpieszuk (author of the ACFML plugin)

November 12, 2019 at 1:14 pm #4931911

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+02:00)

Hi,
Thank you for your feedback.

I consulted this ticket with Konrad and there is a known issue with the latest ACF version that it causing this problem. As a workaround you can downgrade the ACF plugin (not ACFML) to the previous version.

Best regards,
Carlos

November 12, 2019 at 1:42 pm #4932095

Martino

Ok, I fixed with a workaround but I'm interested on when the bug will be fixed.
Should I keep an eye at ACF updates?

November 12, 2019 at 1:54 pm #4932139

Carlos Rojas
Supporter

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

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Is not up-to-us supporters to determine when a fix will be released, however I can tell you that our specialist are working on this issue already. Please keep an eye on ACF and ACFML updates.

Thank you very much for your patience and understanding!
Best regards,
Carlos