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

Last updated by ludovicH-2 1 year ago.

Assigned support staff: Ricardo Alday.

Author Posts
September 29, 2018 at 1:35 pm

ludovicH-2

I am trying to: display ACF translated labels from french to english. I followed the ACF + WPML guide.

Link to a page where the issue can be seen:
Original french post : hidden link
Translated english post : hidden link

I expected to see: translated labels and fields translated with the "Classic Translation Editor"

Instead, I got: no translated labels (translated labels does not display) and the fields translated with the "Classic Translation Editor" won't display (whereas it seems to display when i use "Create translations manually".

October 1, 2018 at 8:25 pm #2779450

Ricardo Alday

Hi,

Thanks for contacting support.

First, make a backup of your database then try the following procedure.

1. Go to ACF -> Groupes de champs, and select the "Infos générales" to edit it.
2. In the field group edit page scroll down until you see the "Configuration du contenu multilingue" panel and select "Rendre 'Groupes de champs' traduisible", click the Apply button at the bottom.
3. Update the field group and the translation.

4. Go to Films -> Tous le films, and select "Je te suis" to edit it.
5. In the film group edit page scroll down until you see the "Configuration du contenu multilingue" and click "Afficher les champs du système"
6. Select all fields and their corresponding hidden field (eg. titre_original and _titre_original), set them to "Traduire", and click the Appliquer button at the bottom.
7. Update the film and its translation. You will now see that the translation editor shows more films now and they will also show on the frontend.

Hope that helps,
Ricardo

October 2, 2018 at 12:54 pm #2781460

ludovicH-2

Hi Ricardo and thank you for your answer. I followed your advices step by step but unfortunately, i did not managed to retrieve the labels in the second language, english in my case, using the "Classic Translation Editor" (which is really convenient for my client). With "Create translations manually" option in WPML parameters, everything works fine. For exemple, i publish a "film" french custom post using "Classic Translation Editor" and translate it to english : labels in french display, not the labels in english. I then go to WPML parameters and change to "Create translations manually" option, update the "film" post and its translation and the labels display in both languages. It's a mystery for me ...

October 2, 2018 at 6:34 pm #2782479

Ricardo Alday

My mistake. To have the ACF labels show translated you must translate the post (Films) using Manual Translations as per our documentation: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#translating-field-groups

"You should only need to translate Field Groups in certain cases. For example, if on the front-end, you want to display different field labels for different languages.

To translate the Field Group, follow the steps below:

Activate the WPML manual translation mode by navigation to WPML -> Setting, under the How to translate posts and pages section, choose the Create translations manually option and Save."

One workaround you can use to keep using the Translation Editor is to modify your template so instead of outputting the field label, it outputs a translatable string.
For example, instead of this:

<div class=""><?php echo $field['label'] . ' : ' . $field['value']; ?></div>

Use something like this:

<div class=""><?php __( 'Titre original', 'FFE18' ); . ' : ' . $field['value']; ?></div>

You will be able to translate those strings via String Translation.

Hope that helps,
Ricardo

October 2, 2018 at 8:37 pm #2782780

ludovicH-2

i think i will follow your advice in translating strings, the result should be identical 🙂 Thanks again for your help.