Hi, my solution:
In the instructions texts I removed the colons of the qtranslate shorttags and add them dynamically with a string replace function in the load field filter followed by the apply_filters function to get the translation.
[en] English text [de] German text []
function qtrans_acf_load_field( $field )
{
// exclude acf-field-group page
if(get_post_type() != 'acf-field-group'){
$instructions = str_replace('[', '[:', $field['instructions']);
$field['instructions'] = apply_filters('the_title', $instructions);
}
return $field;
}
add_filter('acf/load_field', 'qtrans_acf_load_field', 10,3);
I had some problems with the acf-qtranslate plugin, because it has not been updated for a long time.
Try this fork, it works for me: https://github.com/fburatti/acf-qtranslate
Hi James
Thank you. I found out that it was a issue with the acf-qtranslate plugin, not with ACF, because acf-qtranslate has not been updated over a year and some lines of code have changed in the ACF plugin.
But this fork works: https://github.com/fburatti/acf-qtranslate
Anyway the original question is more precisely: How to build a multilingual gallery field.
And I think the answer lies in analysing the acf-qtranslate plugin and reading about “Creating a new field type” https://www.advancedcustomfields.com/resources/creating-a-new-field-type/
Thanks!
Hi James
Thank you.
As described in my first post I’m already using this plugin (acf-qtranslate) for adding an extra qtranslate textfield to attachements.
Unfortunately this is completly broken now with the newest version ACF PRO 5.3.7
When trying to edit the image details in a gallery field, the whole page loads again in the acf-gallery-side instead of the attachement detail editor….
….
Any hint is appreciated 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.