{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Localization/issues/17","labels_url":"https://api.github.com/repos/aspnet/Localization/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Localization/issues/17/comments","events_url":"https://api.github.com/repos/aspnet/Localization/issues/17/events","html_url":"https://github.com/aspnet/Localization/issues/17","id":77150614,"number":17,"title":"Pluralization","user":{"login":"hishamco","id":3237266,"avatar_url":"https://avatars.githubusercontent.com/u/3237266?v=3","gravatar_id":"","url":"https://api.github.com/users/hishamco","html_url":"https://github.com/hishamco","followers_url":"https://api.github.com/users/hishamco/followers","following_url":"https://api.github.com/users/hishamco/following{/other_user}","gists_url":"https://api.github.com/users/hishamco/gists{/gist_id}","starred_url":"https://api.github.com/users/hishamco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hishamco/subscriptions","organizations_url":"https://api.github.com/users/hishamco/orgs","repos_url":"https://api.github.com/users/hishamco/repos","events_url":"https://api.github.com/users/hishamco/events{/privacy}","received_events_url":"https://api.github.com/users/hishamco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-16T22:42:30Z","updated_at":"2015-05-19T02:00:59Z","closed_at":null,"body":"Pluralization is a complex problem, as different languages have a variety of complex rules for pluralization. You may easily manage this in your language files using many techniques such as \r\n\r\n```Notification => You have [one message | many messages] in your inbox```\r\n\r\n```Notification => You have one message in your inbox | You have many messages  in your inbox```\r\n\r\nthis can be done by introducing an optional parameter isPlural in ```GetString``` method, to get the pluralized text from the actual value"},"comment":{"url":"https://api.github.com/repos/aspnet/Localization/issues/comments/103299068","html_url":"https://github.com/aspnet/Localization/issues/17#issuecomment-103299068","issue_url":"https://api.github.com/repos/aspnet/Localization/issues/17","id":103299068,"user":{"login":"hishamco","id":3237266,"avatar_url":"https://avatars.githubusercontent.com/u/3237266?v=3","gravatar_id":"","url":"https://api.github.com/users/hishamco","html_url":"https://github.com/hishamco","followers_url":"https://api.github.com/users/hishamco/followers","following_url":"https://api.github.com/users/hishamco/following{/other_user}","gists_url":"https://api.github.com/users/hishamco/gists{/gist_id}","starred_url":"https://api.github.com/users/hishamco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hishamco/subscriptions","organizations_url":"https://api.github.com/users/hishamco/orgs","repos_url":"https://api.github.com/users/hishamco/repos","events_url":"https://api.github.com/users/hishamco/events{/privacy}","received_events_url":"https://api.github.com/users/hishamco/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T02:00:59Z","updated_at":"2015-05-19T02:00:59Z","body":"@Eilon Hebrew like my language Arabic which has three forms: singular, dual and plural. If i'm not wrong we have 6 plural forms which may the largest number of plural forms in the languages world wide and perhaps the complicated one :)\r\nLet us have a look to the following:\r\n\r\n1 day <=> يوم\r\n2 days <=> يومين\r\n3 days <=> أيام 3\r\n11 days <=> 11 يوما\r\n100 days <=> 100 يوم\r\n\r\nif you look at bing or google translators they treat the dual as plural which may breaks the rules of the language :( nothing but we can think differently by adding expression to determine the proper translation like [Yii Frameowrk](http://www.yiiframework.com/doc/guide/1.1/en/topics.i18n) perhaps it is complicated!!\r\nThis may need a proper design but I come with a humble idea by adding a ```Func<int,int>``` parameter that represent the rules of the language and return the part index that should be taken within the brackets\r\nIf we tried the following code for the English language\r\n```csharp\r\nGetString(\"Notification\",\"Elion\", 2, func(2));\r\n\r\nprivate int func(int n)\r\n{\r\n     if(n!=1)\r\n          return 1;\r\n     else\r\n          return 0;\r\n}\r\n```\r\nthe ```Func``` will return 1 that indicate the second part from ```[day | days]``` and this will produce <b>Posted by Elion 2 days ago.</b>\r\n\r\nWe can apply the same mechanism using Arabic language\r\n&#x202b;```Notification => تم النشر من قبل {0} منذ [ {0} يوم | يوم | يومين | {1} أيام | {1} يوما | {1} يوم ]```\r\n```csharp\r\nGetString(\"Notification\",\"Elion\", 7, func(7));\r\n\r\nprivate int func(int n)\r\n{\r\n     if(n==0)\r\n            return 0;\r\n        else if(n==1)\r\n            return 1;\r\n        else if(n==2)\r\n            return 2;\r\n        else if(n%100>=3&&n%100<=10)\r\n            return 3\r\n        else if(n%100>=11)\r\n            return 4;\r\n        else\r\n            return 5;\r\n}\r\n```\r\nthe ```Func``` will return 3 that indicate the fourth part from &#x202b;```تم النشر من قبل {0} منذ [ {0} يوم | يوم | يومين | {1} أيام | {1} يوما | {1} يوم ]``` and this will produce &#x202b;<b>تم النشر من قبل Elion منذ 7 أيام.</b> which is of course the correct result in my language"}}