How to translate product counts (‘subcategory_count_markup’ function)?
-
Hello,
I am trying to translate the function subcategory_count_markup (class-astra-woocommerce.php) with my custom plugin.How to edit this function in my custom plugin? I tried this:
add_filter( 'subcategory_count_markup', 'subcategory_count_markup_custom' ); function subcategory_count_markup_custom( $content, $category ) { if ($category->count > 4) { $content = sprintf( _nx( '<mark class="count">%1$s Produktów</mark>', '<mark class="count">%1$s Rodzaji</mark>', $category->count, 'product categories', 'astra' ), number_format_i18n( $category->count )); } else if ($category->count < 5) { $content = sprintf( _nx( '<mark class="count">%1$s Produkty</mark>', '<mark class="count">%1$s Rodzaje</mark>', $category->count, 'product categories', 'astra' ), number_format_i18n( $category->count )); } return $content; }
But it doesn’t work…
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to translate product counts (‘subcategory_count_markup’ function)?’ is closed to new replies.