Hi @abbigliamentodalavoro,
use this code snippet to translate FiboSearch labels:
// Add a filter to translate the labels used in FiboSearch
add_filter( 'dgwt/wcas/labels', function ( $labels ) {
$current_locale = get_locale();
// Check the current locale and set the 'sku_label' accordingly.
if ( $current_locale == 'de' ) {
$labels['search_hist'] = 'Ihr Suchverlauf';
$labels['search_hist_clear'] = 'Klar';
} elseif ( $current_locale == 'fr' ) {
$labels['search_hist'] = 'Votre historique de recherche';
$labels['search_hist_clear'] = 'Clair';
}
// You can add more conditions for other languages here.
// Default value if none of the conditions above are met.
else {
$labels['search_hist'] = 'Your search history';
$labels['search_hist_clear'] = 'Clear';
}
return $labels;
} );
// Add a filter to translate text used in FiboSearch Details Panel
add_filter( 'gettext', function ( $translated_text, $text, $domain ) {
$current_locale = get_locale();
if ( 'Select options' === $text ) {
if ( 'de' === $current_locale ) {
$translated_text = 'W?hlen Sie eine Option';
} elseif ( 'en' === $current_locale ) {
$translated_text = 'Select Your Option';
}
// You can add more conditions for other languages here.
}
return $translated_text;
}, 20, 3 );
You have two ways to add this code to your theme:
- Open the
functions.php
in your child theme and add the code at the end.
- or install the Code Snippets plugin and apply this code as a snippet.
Regards,
Kris