21 Aug 23

ACF Chat Fridays: Automatically Translating ACF Fields With ACFML

By Mike Davey

ACF Chat Fridays are live discussions with the ACF team and community on the best ways to build sites with ACF, with insight into new features coming to the plugin.

The August 18th session featured special guests Pierre Sylvestre and Jamal Boulhous of translation plugin WPML, bringing us a demo of WPML and the ACFML add-on. ACFML lets you build multilingual sites using ACF, with translation of ACF field content and labels.

Co-hosted by Iain Poulson and Anthony Burchell.

Sign up for the next session →

ACF Chat Fridays Banner Image.

Session Recording

The entire session, including the ACFML demo, is available in the player below. You can skip to the session summary for the highlights and Q&A.

Session Summary

Iain Poulson started the session with a discussion of some of the major features in the recently shipped ACF and ACF PRO 6.2, including how it brings bidirectional relationships directly into the plugin without the need for code, and the Options Pages UI introduced in ACF PRO.

In addition, Iain noted that ACF has launched a public feedback board where you can post feature requests, comment and vote on proposed features, and help direct ACF’s development roadmap.

He also called out the new and improved documentation for ACF Blocks on the site.

Iain then introduced Pierre Sylvestre of WPML. Pierre is in charge of compatibility for WPML, ensuring it works with the most significant parts of the WordPress ecosystem. He discussed some of the basic functioning of WPML and how the ACFML add-on works with ACF to provide a simple user experience before handing the mic over to Jamal Boulhous to conduct the ACFML demo.

Jamal’s demo used a WordPress site with some ACF field groups already prepared and in use on a Products page using a Repeater field to display a collection of clothing. After showing us around the demo site, Jamal activated the WPML plugin and provided a walkthrough of the setup and translation process.

The first step is to choose the site’s default language, in this case English, and to set the language into which you’d like to translate your ACF fields. Jamal walked us through the entire process, showing us various options to choose from, such as using the same or different fields across languages, as well as ACFML’s automatic translation capabilities. See WPML’s tutorial on translating ACF Blocks for an in-depth look at the process and available options.

While setting up the translation, Jamal also noted that ACFML offers a great deal of granularity in what you choose to translate. For example, an ACF field group for “Products” could have a Repeater field with subfields of a Text field for the name, a Text Area field for the description, and a Number field for the price. In this case, you’d almost certainly want to translate the Text and Text Area fields while leaving the Number field untranslated. ACFML allows you to pick and choose exactly which fields should be translated and which should be the same across languages.

Your Products field group would likely have in Image field as well to display the product in question. Images do not necessarily need “translation,” but you still might want to serve different images to different audiences. For example, a page about driving that’s geared to an audience in the UK should have an image with the driver on the right, while the same page geared to an audience in France would show an image with the driver on the left. This can be accomplished with the WPML Media Translation add-on.

You can see the results for yourself in the video. Setting up WPML and ACFML took Jamal just a few minutes, and the actual translation process was even faster. A good example of just how fast it worked: once Jamal had the fields in the translation queue, he noted that they would process in the background, but the translations were complete before he finished his sentence.

The next session of ACF Chat Fridays takes place September 1st. Just can’t wait that long? Get in touch on Twitter.

Q&A

ACF Chat Fridays is one of the best places for your questions and feedback on ACF. We’ve included a couple of the questions and answers from the latest session below, with minor edits made for clarity and style.

Q: We have an Arabic site using WPML, with the default language set to English. Are there any settings we need to consider regarding how ACF Blocks and theme settings are used?

A: The most important consideration in this case is to determine if you want ACFML to translate the original content, or provide different content for the translated version. For example, say you have a page showing agencies, and you have one agency based in the UK and another based in France. In this case, you don’t want a direct translation, but different fields for each language. In most cases, if you just want the site translated, you’d use the same content across fields.

Q: Will ACFML translate options pages and custom post types created in ACF?

A: The field group driving an options page can be translated with ACFML, but if you’re using ACF’s Options Pages UI, that is not yet translatable with ACFML, although it is on WPML’s roadmap.

As for custom post types created in ACF, the only thing you can’t do right now is natively translate its labels. You can see a list of your custom post types in WPML, and define how they behave when translated. Note that this isn’t limited to custom post types created in ACF, but applies to all of your custom post types. As noted, the only limitation for now is that you won’t be able to translate its label displayed in the back end of your site. This is also WPML’s roadmap.

Q: I’m using an ACF File field, and I’d like to have different files for each language. How would I set the translation preferences?

A: There are different strategies for that, but if it’s a media file, your best bet is likely the WPML Media Translation add-on. This allows you to have different images for each translation, but it goes far beyond image files, allowing you to serve any file to a specific audience. For example, a common use case is to present PDFs in a reader’s native language.

We share relevant resources during the call. We’ll sum them up here and try to provide a bit of context:

Coming Up on ACF Chat Fridays

Join us on September 1st for the next session of ACF Chat Fridays. This session will take place at 2pm GMT.

What do you think we should cover in upcoming sessions? Let us know what you’d like to see on Twitter.

Sign up for the next session of ACF Chat Fridays here:

https://wpeng.in/acf-chat-fridays/

The list of upcoming sessions is below.

  • September 1, 2023
  • September 15, 2023
  • September 29, 2023
  • October 13, 2023

Tag or DM us on Twitter to let us know you’ll be there. Suggest new topics, let us know what you’d like to see, and send us feedback with #ACFChatFridays on Twitter.

Supercharge Your Website With Premium Features Using ACF PRO

Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.

Explore Features View Pricing

PRO Features
ACF Blocks
Options Pages
PRO Fields
Repeater
Flexible Content
Gallery
Clone

About the Author

For plugin support, please contact our support team directly, as comments aren't actively monitored.