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.

This topic contains 4 replies, has 2 voices.

Last updated by Bigul 7 months, 3 weeks ago.

Assigned support staff: Bigul.

Author Posts
November 18, 2019 at 3:35 pm #4966439

Martino

Hi there,
I'm using ACF, Facet WP and custom post types and taxonomies.

I would like to be able to use the translated version of both the ACF checkboxes and taxonomies as facets for a filterable view of my custom post types page.

As of now I really don't understand what's the best way to make it work.

These are the steps i followed:
- created the CPT and make it translatable
- create the custom taxonomy and translate
- create di ACF group with a single field with checkboxes
- tried to duplicate it or use it as "not translatable" but put "copy" as option for the field

The main language shows the correct facets and content,
the secondary language shows no facets.

hidden link

Also I think there is some problem with the cache since a non logged in user can't use the facets in english too.

November 21, 2019 at 5:46 am #4985327

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue.

Please visit the following URL and make sure you have the correct settings for the ACF fields and field groups.

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

Also please try the following steps after a site backup and make sure you are getting the expected result or not.

1) Upgrade to the latest version of WPML 4.3.4
2) Open the post having an issue in the default language for edit
3) Scroll down to *Multilingual Content Setup* widget
4) Click on *Show system fields* link
5) Set *Copy* as the translation preference for the ACF system fields
6) Apply the changes
7) Update the Post and its translation(just resave)

If the issue exists, please share a screenshot for a better understanding of the issue. Because the English and Italian posts look like almost the same - hidden link

--
Thanks!

Bigul

November 21, 2019 at 10:09 am #4986621

Martino

Hi Bigul,
thanks for the reply.

I followed your instruction but still it doesn't work:
I can't find a way to translate in the WP backend the checkbox strings.

You see a correct image since I'm using an ugly functions.php snippet to translate it:

if (ICL_LANGUAGE_CODE == "it") {
add_filter( 'facetwp_facet_html', function( $output, $params ) {
    if ( 'area_prodotto' == $params['facet']['name'] ) {
        $current_values = array( 'Building Sector', 'Wire Rod' );
        $replace_values = array( 'Edilizia', 'Vergella' );
        $output = str_replace( $current_values, $replace_values, $output );
    }
    return $output;
}, 10, 2 );

function custom_translate( $input ) {
    $current_values = array( 'Building Sector', 'Wire Rod' );
    $replace_values = array( 'Edilizia', 'Vergella' );
    return str_replace( $current_values, $replace_values, $input );
}

}

Now I've commented it, so the english language is always showing for the "product" facet.
I added the checkbox info in the single box as well:
hidden link
I could manage with the functions.php solution but it kind of complex and hard to maintain.

November 21, 2019 at 3:38 pm #4990181

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for the feedback. Please fill the private details fields after a full site backup. I would like to access the admin area of your site for further checking.

Please check the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

--
Thanks!

Bigul

November 22, 2019 at 12:47 pm #4997791

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for the login information. Please check the attached images. ACF Field Group is created in English and it is not translated or duplicated to Italian. So please try the following steps and make sure you are getting the expected result or not.

1) Visit WPML>>Settings
2) Scroll down to *Post Types Translation* section
3) Choose *Not translatable* option for *Field Group(acf-field-group)* post type
4) Save the changes

--
Thanks!

Bigul

The topic ‘[Closed] ACF checkboxes + Facet WP: best practice?’ is closed to new replies.