Viewing 1 replies (of 1 total)
  • Plugin Support Kris

    (@c0nst)

    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:

    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the Code Snippets plugin and apply this code as a snippet.

    Regards,
    Kris

Viewing 1 replies (of 1 total)
  • The topic ‘missing translation’ is closed to new replies.