{"action":"created","issue":{"url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/89","labels_url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/89/comments","events_url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/89/events","html_url":"https://github.com/SlexAxton/messageformat.js/issues/89","id":57607527,"number":89,"title":"Issue with plural offset?","user":{"login":"ryanzec","id":444206,"avatar_url":"https://avatars.githubusercontent.com/u/444206?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanzec","html_url":"https://github.com/ryanzec","followers_url":"https://api.github.com/users/ryanzec/followers","following_url":"https://api.github.com/users/ryanzec/following{/other_user}","gists_url":"https://api.github.com/users/ryanzec/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanzec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanzec/subscriptions","organizations_url":"https://api.github.com/users/ryanzec/orgs","repos_url":"https://api.github.com/users/ryanzec/repos","events_url":"https://api.github.com/users/ryanzec/events{/privacy}","received_events_url":"https://api.github.com/users/ryanzec/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-13T14:54:22Z","updated_at":"2015-02-13T18:22:04Z","closed_at":"2015-02-13T18:15:09Z","body":"So I was implementing this library in a new project and wanted to test out all the features myself and I think I found an issue.  I have this string:\r\n\r\n```\r\nYou {NUM, plural, offset:1 =0{didn't like} zero{like} one{and 1 other person likes} other{and # others like}} this post\r\n```\r\n\r\nand the following code:\r\n\r\n```javascript\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 0\r\n});\r\n// OUTPUT: You didn't like this post\r\n\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 1\r\n});\r\n// OUTPUT: You and 0 others like this post\r\n\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 2\r\n});\r\n// OUTPUT: You and 1 other person likes this post\r\n\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 4\r\n});\r\n// OUTPUT: You and 3 others like this post\r\n\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 8\r\n});\r\n// OUTPUT: You and 7 others like this post\r\n\r\nwindow.i18n['desktop/home'].pluralOffset({\r\n  NUM: 1000\r\n});\r\n// OUTPUT: You and 999 others like this post\r\n```\r\n\r\nI am not sure why when the value is 1, it is selecting the `other` version instead of the `zero` version (since `zero` should work off the offset number).\r\n\r\nI am not hugely concerned about this since this is not a very common use case for me and I can work around it by doing `1{like}` instead of `zero{like}` but wouldn’t this be a bug?\r\n\r\nI should mention I am using the CLI compiled version of the i18n.js file."},"comment":{"url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/comments/74300554","html_url":"https://github.com/SlexAxton/messageformat.js/issues/89#issuecomment-74300554","issue_url":"https://api.github.com/repos/SlexAxton/messageformat.js/issues/89","id":74300554,"user":{"login":"ryanzec","id":444206,"avatar_url":"https://avatars.githubusercontent.com/u/444206?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanzec","html_url":"https://github.com/ryanzec","followers_url":"https://api.github.com/users/ryanzec/followers","following_url":"https://api.github.com/users/ryanzec/following{/other_user}","gists_url":"https://api.github.com/users/ryanzec/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanzec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanzec/subscriptions","organizations_url":"https://api.github.com/users/ryanzec/orgs","repos_url":"https://api.github.com/users/ryanzec/repos","events_url":"https://api.github.com/users/ryanzec/events{/privacy}","received_events_url":"https://api.github.com/users/ryanzec/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T18:22:04Z","updated_at":"2015-02-13T18:22:04Z","body":"@eemeli Sorry about the first output, it was a mistake on my part and updated it to want I actually get (which is the correct text).\r\n\r\nAlso good to know that what I was seeing was a bug in the docs and not the code."}}