[Resolved] "1" showing up instead of translated content
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is trying to translate ACF repeater fields on an options page. Some items translate correctly, while others display outdated content or the number "1" instead of the translated text. The issue is visible on the provided page, and discrepancies between the backend content and frontend display are noted.
Solution: 1) Ensure the main repeater field is set to COPY and the text subfield to TRANSLATE for both languages. Save the options page in the default language, switch languages, and save again.
2) If the problem persists, deactivate all plugins except WPML and ACF, and switch to the default WP theme to check if the issue is caused by other code or plugins.
3) Set the ACF Field Group to 'Not Translatable', delete any duplicate groups in other languages, leaving only the default language. Then, re-save the options page. For more details, see the errata page.
I am trying to translate ACF fields on an options page.
The field is a repeater field. Some of the items in the repeater field are translating ok, but some are showing translated content that is blank in the original (old content?) and one is showing the number "1" for all translated fields in that section instead of the translated text.
Link to a page where the issue can be seen: hidden link
I've attached 4 images: the front end of the german page and its english translation ("1"s) and the backend of the german page and its english translation (actual english text).
The first section that shows the heading:
Quality and Competence
CEO Management
on the English page also does not match the english content in the backend.
I would like for you to try the next few things and see if the issue still happens:
1) Make sure the main repeater field is set to COPY, and the text subfield is set to Transalte. I see you have set the ACF field group as translated, so make sure to set this for both languages.
Go to your options page, save in the default language, switch languages, and save again.
Check if the issue still happens.
2) If the issue still happens, check if the issue still happens when using only WPML plugins and ACF, all others are disabled while using the WP default theme.
This is to check if the issue is caused by some other code or plugin.
3) Field Group should be set as Not Translatable, make sure to set them like that and delete the duplicate groups that now appear. Re-save one left, and resave the options page, check if the issue still happens.
I'm testing on a local development site that was just cloned from the production site.
1. I made sure those are the settings, saved the default language, switched and saved again. The issue remains.
2. I disabled everything except WPML and ACF plugins. The issue remains.
3. My field groups are set as translatable and they've all been copied into the second language (this is an older site and this is what I was advised to do at the time) so if I change this I now have duplicate fields on the settings page (and probably on all pages). If I save anyway, everything disappears from the front end.
3) Okay, please leave them as translatable, and delete the groups from all other languages, leaving them only in default. Then set the ACF group to be not translatable. Check if the issues till happen.
4) If yes, then there could be bug from our side. I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons.
You can access the WordPress dashboard using the link below:
-hidden link
Kindly follow the steps below:
- Set up WPML
- Install the necessary plugins.
- Try to replicate the issue.
- Share with me step by step guide on how can I check the issue and steps you did
This will help us to report the probable issue to the compatibility team and solve the possible problem faster.
Ok so this works, but in the process, I lose all of my data, so I have to reenter everything. I've been testing on a local site so this wasn't a problem, but on the live site, I am going to have to do this piecemeal. All of my ACF field groups have been duplicated in the second language.
So my question now is can I switch the Field Group settings back and forth from translatable to not translatable in order to do this one section at a time? Will this cause any issues?
I think you can do so, but then not update 2nd language pages that do not have field groups in 2nd language, as this will cause again for content to be lost again.
Anyway, you can for example create a new staging website, and leave there translatable and on live set to Not translatable, and then manually copy and paste your content there, without the need to switch back and forth on the live website.
For now this seems resolved. I deleted all the second language and changed the field groups to "not translate". Then I only had to re-add the content for the settings pages. The normal posts, pages and custom post types can still be translated normally and the content doesn't disappear. We haven't tried to translate everything on the site, so we'll just have to see if we run into any more issues, but this was helpful to determine the best way to handle translations going forward. This seems like a definite improvement from how this needed to be done in the past.
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.