{"action":"created","issue":{"url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/150","labels_url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/150/comments","events_url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/150/events","html_url":"https://github.com/twigphp/Twig-extensions/issues/150","id":100988724,"number":150,"title":"Problem with localizednumber('duration')","user":{"login":"sc0rp10","id":597762,"avatar_url":"https://avatars.githubusercontent.com/u/597762?v=3","gravatar_id":"","url":"https://api.github.com/users/sc0rp10","html_url":"https://github.com/sc0rp10","followers_url":"https://api.github.com/users/sc0rp10/followers","following_url":"https://api.github.com/users/sc0rp10/following{/other_user}","gists_url":"https://api.github.com/users/sc0rp10/gists{/gist_id}","starred_url":"https://api.github.com/users/sc0rp10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sc0rp10/subscriptions","organizations_url":"https://api.github.com/users/sc0rp10/orgs","repos_url":"https://api.github.com/users/sc0rp10/repos","events_url":"https://api.github.com/users/sc0rp10/events{/privacy}","received_events_url":"https://api.github.com/users/sc0rp10/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-14T10:55:08Z","updated_at":"2015-08-14T12:24:44Z","closed_at":null,"body":"I have 'ru_RU' locale and I want to format duration: `{{ 10240 | localizednumber('duration') }}`\r\nExpected result is *2:50:40*, but i got *10 240*.\r\nI played with INTL PHP provider and see that NumberFormatter doesn't have full pattern for ru_RU:\r\n```\r\n$en_formatter = new \\NumberFormatter('en_US', \\NumberFormatter::DURATION);\r\nvar_dump($en_formatter->getPattern());\r\n$ru_formatter = new \\NumberFormatter('ru_RU', \\NumberFormatter::DURATION);\r\nvar_dump($ru_formatter->getPattern());\r\n````\r\nAnd I got:\r\n```\r\nstring(544) \"%with-words:\r\n    0: 0 seconds;\r\n    1: 1 second;\r\n    2: =#0= seconds;\r\n    60/60: <%%min<;\r\n    61/60: <%%min<, >%with-words>;\r\n    3600/60: <%%hr<;\r\n    3601/60: <%%hr<, >>>;\r\n%%min:\r\n    0: 0 minutes;\r\n    1: 1 minute;\r\n    2: =#0= minutes;\r\n%%hr:\r\n    0: 0 hours;\r\n    1: 1 hour;\r\n    2: =#0= hours;\r\n%in-numerals:\r\n    0: =#0= sec.;\r\n    60: =%%min-sec=;\r\n    3600: =%%hr-min-sec=;\r\n%%min-sec:\r\n    0: :=#00=;\r\n    60/60: <#0<>%%min-sec>;\r\n%%hr-min-sec:\r\n    0: :=#00=;\r\n    60/60: <#00<>%%hr-min-sec>;\r\n    3600/60: <#,##0<:>>>;\r\n%d\r\n```\r\n```\r\nstring(27) \"%duration:\r\n    0: =#,##0=;\r\n\"\r\n```\r\nAs I see, ru_RU locale isn't full and don't support any of formats.\r\nMaybe need force locale to en_US, if `$style == 'duration'` in `Twig_Extensions_Extension_Intl`?"},"comment":{"url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/comments/131092335","html_url":"https://github.com/twigphp/Twig-extensions/issues/150#issuecomment-131092335","issue_url":"https://api.github.com/repos/twigphp/Twig-extensions/issues/150","id":131092335,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T12:24:44Z","updated_at":"2015-08-14T12:24:44Z","body":"Well, as you can see, the fix is not as simple as forcing ``en_US`` all the time, because this would break 515 working locales.\r\n\r\nand in any case, this should still be reported to PHP to reduce the list of broken locales in the future"}}