This thread is resolved. Here is a description of the problem and solution.
Problem: Unable to translate acf checkboxes labels.
Solution: 1. Navigate to ACF->Tools and enable the option 'Scan local fields for changes to translation preferences.' and save the changes. 2. Go to WPML->Strings Translations->Auto Register strings for translations and enable the 'Look for strings while pages are rendered' option. 3. Visit the page on the front-end where the string is shown to automatically register strings from that page. 4. Return to WPML->Strings Translations->Auto Register strings for translations and disable the previously enabled options. 5. Search for the strings in WPML->String Translations and translate all instances that appear.
I've attached an image of screenshots with notes that you can follow along with. Note that this is a multisite environment, but this question only involves the main site of the multisite environment.
================
Original English Page hidden link
If you scroll down on this page, you'll encounter a section with a heading of "Divisions". I want this section to show the translated versions of the labels (e.g. Corporate Services).
================
ACF Field Group
In the second panel of the attached image, you'll see the Advanced Custom Fields (ACF) field group that handles this data (acf-field-group-69). You'll see the "Division" field is a checkbox and the Choices section contains the value:label pairs.
================
WPML String Translation
In the third panel of the attached image, you'll see the String Translation screen of the WPML admin. I've filtered this to show the ACF field group in question (acf-field-group-69). You will see by the + signs next to these items that I've provided translations for them. I've expanded the "Corporate Services" item to show the provided translation.
================
Dutch Translated Page hidden link
In the final panel of the attached image, you'll see the translated version of the page. The content above the "Divisions" list has been translated, but the labels for the choices have not been translated.
================
Questions
1. What am I doing wrong?
2. What information do you need from me besides what I've provided?
1. The field was already set to Copy (see attachment).
2. The front end is being generated by a custom coded theme. The team_division Advanced Custom Field's "Return Value" is set to "Both (Array)" because I'm using both the Value and the Label in the code.
Let me know if you want to see the code. I'm simply iterating over the array the ACF field returns.
To debug this issue further, I would need to check your site settings once, for this I would need temporary access (wp-admin and ftp) to your site.
So could you please provide me with those details, you will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link
It seems like I don't have permissions to view the plugins as well as edit theme files, which is required here to debug the issue further, being so can you upgrade my account to have those privileges and if possible provide ftp details.
I deleted the string translations from your site to test the issue further, it resulted in more errors due to the way the theme is set up but I managed to get it back.
I then set up a fresh new setup with ACF and tested it there and it worked without any issues.
After a lot of debugging, I managed to find out that the issue was due to acf-json being used on the site.
So to fix the issue, please follow the below steps:
- Go to ACF->Tools and enable " Scan local fields for changes to translation preferences." and save hidden link
- - Go to WPML->Strings Translations->Auto Register strings for translations
- Enable the "Look for strings while pages are rendered" option
- Now visit the page on front-end where the string is shown, this will automatically register strings from that page
- Now go to WPML->Strings Translations->Auto Register strings for translations and disable the options
- Search for the strings in WPML->String Translations and translate it, there will be more than 1 or 2 instances, so translate all of them.
Shekar -- This looks like it's working. It's hard following along what's going on, but at this point I'll just take it working.
Questions:
1) Regarding the "WPML > String Translation > Auto register strings for translation > Look for strings while pages are rendered" setting, am I correct in assuming I should only turn this on briefly to capture these items and then turn it off?
2) Same question with the "ACF > Tools > Scan local fields for changes to translation preferences"?
Please, don't close this ticket until I can give this a shot on the production environment, which I will need to coordinate with my team.
Thank you for the help, this has been a tough one.
Shekar -- I will be performing this on our production environments early on Saturday morning EST time in the USA. If things go well, I'll come here and close the ticket. Thank you.
Questions:
1) Regarding the "WPML > String Translation > Auto register strings for translation > Look for strings while pages are rendered" setting, am I correct in assuming I should only turn this on briefly to capture these items and then turn it off?
2) Same question with the "ACF > Tools > Scan local fields for changes to translation preferences"?
Yes.
Sure, the ticket will be opened for a week without any activity.
This issue is resolved. Your solution worked, but in-case it helps someone else who might find this thread, I came-up with another solution as well.
Instead of relying on WPML to handle the translation of the checkbox label in the described fashion, I used the _e( $label, $domain ) function and then added the string translations myself.
Regardless, thank you for the help. I'm happy to close this ticket!
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.