To achieve filtering according to the locale de_DE
for the taxonomy terms displayed in the search box selector, you can use a similar approach as your archive title filter.
add_filter('wp_dropdown_categories', function( $output, $args ) {
$locale = get_locale();
if ('de_DE' == $locale && $args['taxonomy'] == 'tipologia') {
// Modify output for German locale and 'tipologia' taxonomy
$terms = get_terms([
'taxonomy' => 'tipologia',
'hide_empty' => false,
]);
if ($terms && !is_wp_error($terms)) {
$output="<select name="" . esc_attr($args['name']) . '">' . "\n";
$output .= '<option value="0">' . esc_html__('Typology', 'sacconicase') . '</option>' . "\n";
foreach ($terms as $term) {
$output .= '<option value="' . esc_attr($term->slug) . '">' . esc_html($term->name) . '</option>' . "\n";
}
$output .= '</select>' . "\n";
}
}
return $output;
}, 10, 2);