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
/wp-content/plugins/wp-grid-builder/frontend/facets/class-select.php
file.
2. Inside
Select::render_options()
, around line 142, replace the code snippet with the provided workaround that includes WPML filters for registering and translating strings.
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 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.
Tagged: Compatibility, Go Global Application
This topic contains 17 replies, has 3 voices.
Last updated by Osama Mersal 6 months, 2 weeks ago.
Assisted by: Osama Mersal.
Author | Posts |
---|---|
April 19, 2024 at 9:25 am #15542593 | |
athinaK-2 |
I although I translated the ACF Fields correct they aren't showing |
April 19, 2024 at 11:11 am #15543232 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. 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. See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security. Regards. |
April 19, 2024 at 12:57 pm #15543738 | |
athinaK-2 |
Sorry forgot to share website: hidden link |
April 20, 2024 at 5:02 am #15545413 | |
athinaK-2 |
Just wanted to check in if someone if working on this issue since I haven't heard anything in a day. Thank you. |
April 21, 2024 at 1:10 pm #15547348 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, 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? Best regards, |
April 22, 2024 at 4:58 am #15547993 | |
athinaK-2 |
I am not sure how to recreate the issue. WP Gridbuilder is a paid plugin only allowed on one website so I can't install it on the test site. |
April 22, 2024 at 10:01 am #15549431 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, I installed the WP Grid Builder without activation and imported your grid along with the facets. Would you please try to replicate the issue? Thanks, |
April 22, 2024 at 12:33 pm #15550313 | |
athinaK-2 |
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! |
April 22, 2024 at 1:57 pm #15551031 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for replicating the issue. Please check if the filter is translated correctly. I translated the accommodation post, which fixed the issue. Best regards, |
April 22, 2024 at 2:19 pm #15551225 | |
athinaK-2 |
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) |
April 22, 2024 at 3:45 pm #15552104 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, I've consulted our 2nd tier support team regarding this issue, and I'll update you as soon as I get their reply. Best regards, |
April 26, 2024 at 1:03 pm #15570785 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, 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 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 $output = '<div class="wpgb-checkbox" role="button"' . $attributes . '>'; With // 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); } $output = '<div class="wpgb-checkbox" role="button"' . $attributes . '>'; 5- Visit the page with the facets in the original language to register the strings ❌ Please backup your database before performing the above steps ❌ Note: On your website, the default language is Dutch, but the strings are registered in English. So, you may need to change the language of the string to Dutch before translating it. Kindly check this guide. (https://wpml.org/documentation/getting-started-guide/string-translation/how-to-change-the-source-language-of-strings/) Best regards, |
April 29, 2024 at 3:54 am #15574540 | |
athinaK-2 |
I was a weekend away. Trying to look at it today. |
April 29, 2024 at 7:01 am #15574830 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Sure, please take your time and let me know if the workaround fixed the issue. Best regards, |
April 29, 2024 at 10:57 am #15576668 | |
athinaK-2 |
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? |