First of all it’s really really awesome we have finally a way to translate fields.
Because I’ve waited for it I’ve already tried it and found that translations are not showing.
I did some digging and it looks like the strings are properly translated, but not assigned to the field.
In file /api/api-field.php around line 180 there is
acf_translate_keys( $field, acf_get_setting('l10n_field') );
The acf_translate_keys returns translated string, but it’s not assigned to anything.
I’ve changed it to
$field = acf_translate_keys( $field, acf_get_setting('l10n_field') ); and it’s working as expected
Same goes for group names in /api/api-field-group.php line 74. I’ve changed:
acf_translate_keys( $field_group, acf_get_setting('l10n_field_group') );
$field_group = acf_translate_keys( $field_group, acf_get_setting('l10n_field_group') );
And with that everything works as expected so far.
Ok, the only thing I can’t seem to get working is the “label” for the flexible content layouts. Each label inside the layouts are with those changes translated, except the title of that layout. I tried to find where could be a problem but it looks like acf_translate_keys() i never called for this one.
The developer of ACF does not really get around to these forums very often, it’s mostly for users helping other users. I think this might be something the developer would like to be aware of, it could even be a bug.
I would suggest that you submit a new support ticket. You can do this several ways. There is a link on the support home page in the right sidebar to open a support ticket, you can also click this link.
Well, at one time it was, but the developer has found that he does not have time to keep up with it all himself so he has people to try an keep up with it for him.
And sometimes other users can help solve bugs, or what looks like a bug, so posting here is usually a good idea in many cases before starting a support ticket.
You must be logged in to reply to this topic.
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!
ACF PRO’s Flexible Content field allows you to create smaller pieces of UI and compose them into whole flexible patterns. In our latest article, we show how to use it to create swappable site sections and integrate it all in a theme.https://t.co/ZRocH8oJSp— Advanced Custom Fields (@wp_acf) January 24, 2023
© 2023 Advanced Custom Fields.