- September 26, 2022
The ACF Blocks feature allows you to create custom block types. Here, we’ll show you how to translate them using WPML.
If you want to learn how to translate ACF fields in general, see the Translate Sites Built with ACF page.
Before getting started, make sure to install and activate the Advanced Custom Fields, WPML core, WPML String Translation, and Advanced Custom Fields Multilingual plugins.
With WPML, you can translate ACF block content just like any other WordPress Gutenberg block. For more information on how to create and use ACF Blocks, check out the post introducing ACF Blocks.
In our example, we have created a simple Testimonial block with ACF. Let’s see how to set the block’s ACF field translation preference and translate the block’s content using WPML’s Translation Editor.
Start by creating the block field group by navigating to Custom Fields → Add New:
- Fill in the field group name and add the custom fields.
- Set the appropriate translation preferences for each field type.
- Scroll down to the Settings section and in Location Rules, set the field group to show when the Block is equal to Testimonial. When you’re done, don’t forget to click on the Save Changes button.
Now, go to Posts → Add New and fill in the post title. Then:
- Click on the plus icon in the content editor and insert the ACF block you created into a post. In our case, it is the Testimonial block.
- Fill in the block content and Publish the post.
- In the Language box, click the plus icon next to the language you want to translate your post into.
- You will be taken to the Advanced Translation Editor. If you have translation credits, you can translate the content automatically. If not, add the translations for each line and click Complete when you’re done.