Since version 1.1.17 of WordPress plugin Simple Counters were added two filters for possibility of your own localization of badge phrases. Why filters? Why not parameters? Because different languages have different number of plural forms and rules of using these forms. It means that we don’t know how many plural forms we need to save as parameters. Filters are better in this case because programmer can independently define number of plurals and rules of their using.
For your own localization of words «readers» and «followers» you can use plugin filters «simple_counters_localization_feedburner» and «simple_counters_localization_twitter«. In order to use them, you must add to the file functions.php theme template the following code:
1 2 3 4 5 |
// Simple Counters filter for Twitter add_filter('simple_counters_localization_twitter', 'sc_twitter_str', 10, 2); function sc_twitter_str($text, $count) { return "total"; } |
or this code:
1 2 3 4 5 6 7 8 9 10 11 12 |
// Simple Counters filter for FeedBurner add_filter('simple_counters_localization_feedburner', 'sc_feedburner_str', 10, 2); function sc_feedburner_str($text, $count) { $value = $text; $plural = ($count % 10 == 1 && $count % 100 != 11 ? 0 : $count % 10 >= 2 && $count % 10 <= 4 && ($count % 100 < 10 || $count % 100 >= 20) ? 1 : 2); switch($plural) { case 0: $value = 'подписчик'; break; case 1: $value = 'подписчика'; break; case 2: $value = 'подписчиков'; break; } return $value; } |
or this code:
1 2 3 4 5 6 7 |
// Simple Counters filter for FeedBurner add_filter('simple_counters_localization_feedburner', 'sc_feedburner_str', 10, 2); function sc_feedburner_str($text, $count) { if($count == 1) $value = 'friend'; else $value = 'friends'; return $value; } |
Note! You must use filters of Simple Counters only in next cases:
- Plugin has not localization for your language
- You don’t like standard localization of words “readers” and “followers” for your language
© 2011 – 2018, minimus. All rights reserved.
@minimus: Using filters of Simple Counters //t.co/SDJZCigJ
Hi Minimus,
Great Plugin! Thankyou.
Would you have any idea why I can’t get twitter followers to show up in the box? Feedburner readers do, but not Twitter. I have checked user name several times but I can’t figure this out.
Thanks for your help.
Total Comment by Darren Noble: 1
Twitter API URL was changed by developers. Wait new version of SC.