Urban Giraffe Support | Translation & Localization
How to localize $cat_count?
Hello there. I'm preparing the TMA theme for localization (ngettext, __, _e) and I'm almost ready. However, there's a tiny post counter within categories (archive.php), that doesn't seem to be ngettextable. Any ideas how to wrap the following function to be translatable by poedit to other languages with different plurals?
<?php echo $cat_count . ($cat_count==1?" post":" posts") ?>
Cheers
Responses
Posted 5 months ago by Key Master
You just need to convert it into a ngettext statement that's part of a printf statement:
printf (_ngettext ('%d post', '%d posts', $cat_count), $cat_count);
Reply
You must log in to post.