Home›Support›English Support›[Resolved] I although I translated the ACF Fields correct they aren't showing
[Resolved] I although I translated the ACF Fields correct they aren't showing
This thread is resolved. Here is a description of the problem and solution.
Problem: The client has translated ACF fields for a custom post type 'accommodaties' but the translations are not showing on the English version of the site.
Solution: We recommend the following steps to resolve the issue: 1. Open the
, around line 142, replace the code snippet with the provided workaround that includes WPML filters for registering and translating strings. 3. Open the
, around line 339, replace the code snippet with the provided workaround similar to step 2. 5. Visit the page with the facets in the original language to register the strings. 6. Go to WPML > String Translation and translate the strings.
Before making these changes, ensure to back up your database. Additionally, if the default language on the website is Dutch and the strings are registered in English, the language of the string may need to be changed to Dutch before translating. For guidance on changing the source language of strings, refer to the documentation.
Please note that this solution might be outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket for further assistance.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Meanwhile this ticket is attended by one of my colleagues, may I ask for admin access to your website to check the issue in detail? You can create a separate admin user for this purpose, which can be deleted afterwards.
Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.
Remember to take full backup of your website and database before proceeding. However, a staging/test site is highly recommended, because we may need to try some changes/fixes on the site (including plugins & themes deactivation), which may cause conflicts with the live site otherwise.
Please confirm it in your next reply or let us know if you do not agree with the mentioned.
I've set your next reply as private to share this information safely.
IMPORTANT: If you don't see the section for providing access information, do not write in the message box or the information may appear as public.
I'm Osama from WPML forums support. I'll be glad to help you today.
1) First of all, sorry for the late reply; it was due to a higher workload. I tried some workarounds with no luck, so I created a new sandbox site and imported your field group.
Please log in to this sandbox site and install the WP Grid Builder. (hidden link)
After that, please create a test grid with the same filter to replicate the issue. If the issue is replicable, please let me know to consult our compatibility team.
2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me much information about how your site is configured.
I created within ACF a new post type 'accommodaties'. Its visible in the menu on the left of the dashboard. And I added a new 'accommodatie' as well. I also made a page (hidden link) where the grid is visible including a Dutch translation of it.
I also translated all the 'popular filters' via strings translations ACF-field-group. Since that's the only one that's causing a problem on my website on the English (the translated) version.
I am not sure what else to do. The grid building myself was already very hard haha so trying it again the same way is very difficult. Of course, if I could re-create the issue I'd probably know what caused the issue.
Let me know if I can do anything else. I also provide you with the debug info in my previous message btw!
I see that too, but still not sure how to fix it on my website. Everything was already fully translated but it shows half of it is English and half is Dutch on the English version (hidden link)
Thanks for your patience. Our compatibility team has found a workaround for this issue. Please check the following steps:
1- Open the (/wp-content/plugins/wp-grid-builder/frontend/facets/class-select.php) file
2- Inside Select::render_options(), around line 142, replace the following snippet:
foreach ( $items as $index => $item ) {
With
foreach ( $items as $index => $item ) {
// WPMl Workaround for wpmlsupp-11647
if ( class_exists('Sitepress') ) {
$string = $item->facet_name;
$textdomain = 'facets';
$string_name = 'Facet: '.substr($string, 0, 20);
if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) {
do_action( 'wpml_register_single_string', $textdomain, $string_name, $string );
}
// Apply the translation to the string
$item->facet_name = apply_filters('wpml_translate_single_string', $string , $textdomain, $string_name);
}
3- Open the (/wp-content/plugins/wp-grid-builder/frontend/facets/class-checkbox.php) file
4- Inside Checkbox::render_checkbox(), around line 339, replace the following snippet:
Hi! I think it's solved now. The only thing I am wondering: the files that have now been modified will they be automatically overwritten again when the plugin is updated. How does that work?
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.