How to localize $cat_count?

5 months ago | halibutt (Member) | |

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

Read responses...

Responses

  1. John:

    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.

Home | Software | Terms & Conditions | Sitemap | John Godley © 2008