{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/ecma402/issues/31","repository_url":"https://api.github.com/repos/tc39/ecma402","labels_url":"https://api.github.com/repos/tc39/ecma402/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/tc39/ecma402/issues/31/comments","events_url":"https://api.github.com/repos/tc39/ecma402/issues/31/events","html_url":"https://github.com/tc39/ecma402/issues/31","id":106672803,"number":31,"title":"Intl.DisplayNames API","user":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"labels":[{"id":176914234,"url":"https://api.github.com/repos/tc39/ecma402/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tc39/ecma402/milestones/2","html_url":"https://github.com/tc39/ecma402/milestone/2","labels_url":"https://api.github.com/repos/tc39/ecma402/milestones/2/labels","id":1613293,"number":2,"title":"4th Edition","description":"","creator":{"login":"caridy","id":38969,"avatar_url":"https://avatars.githubusercontent.com/u/38969?v=3","gravatar_id":"","url":"https://api.github.com/users/caridy","html_url":"https://github.com/caridy","followers_url":"https://api.github.com/users/caridy/followers","following_url":"https://api.github.com/users/caridy/following{/other_user}","gists_url":"https://api.github.com/users/caridy/gists{/gist_id}","starred_url":"https://api.github.com/users/caridy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caridy/subscriptions","organizations_url":"https://api.github.com/users/caridy/orgs","repos_url":"https://api.github.com/users/caridy/repos","events_url":"https://api.github.com/users/caridy/events{/privacy}","received_events_url":"https://api.github.com/users/caridy/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":0,"state":"open","created_at":"2016-02-29T20:49:49Z","updated_at":"2016-04-01T07:52:19Z","due_on":"2017-03-01T08:00:00Z","closed_at":null},"comments":6,"created_at":"2015-09-16T00:16:14Z","updated_at":"2016-12-19T22:11:36Z","closed_at":null,"body":"There's a lot of data related to Language names, Timezone names, Script names and Region names contained in CLDR that would allow many App Settings to be easier to develop.\n\nMany popular applications contain some combination of \"language selector\" and \"timezone selector\" in their UI. We use it in Firefox OS and Firefox desktop, but most of popular webapps like Gmail, Facebook or Twitter do the same.\n\nIt would be awesome to tap into CLDR resources and expose the ability to get localized versions of those tokens. We'll want to do this for Firefox OS as part of the 'mozIntl' API and I think it would make sense to standardize it.\n\nOpen questions:\n- We'll have to fallback gracefully if the localized value for the token is not available\n- We'll need to evaluate the disk space cost of that data. I can see us not wanting to keep Script/Region/Territory data, and only expose Language/Timezone. But it would be smart to design API to allow us to expose more in the future.\n- Most use cases will involve a loop to retrieve many names (for a drop-down selector), so the function that retrieves the name for a given language has to be fast, but we probably don't want to load all strings into memory. Need to design the spec for balance.\n"},"comment":{"url":"https://api.github.com/repos/tc39/ecma402/issues/comments/268093565","html_url":"https://github.com/tc39/ecma402/issues/31#issuecomment-268093565","issue_url":"https://api.github.com/repos/tc39/ecma402/issues/31","id":268093565,"user":{"login":"zbraniecki","id":449986,"avatar_url":"https://avatars.githubusercontent.com/u/449986?v=3","gravatar_id":"","url":"https://api.github.com/users/zbraniecki","html_url":"https://github.com/zbraniecki","followers_url":"https://api.github.com/users/zbraniecki/followers","following_url":"https://api.github.com/users/zbraniecki/following{/other_user}","gists_url":"https://api.github.com/users/zbraniecki/gists{/gist_id}","starred_url":"https://api.github.com/users/zbraniecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbraniecki/subscriptions","organizations_url":"https://api.github.com/users/zbraniecki/orgs","repos_url":"https://api.github.com/users/zbraniecki/repos","events_url":"https://api.github.com/users/zbraniecki/events{/privacy}","received_events_url":"https://api.github.com/users/zbraniecki/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T22:11:36Z","updated_at":"2016-12-19T22:11:36Z","body":"For SpiderMonkey/Gecko I landed a non-public API `mozIntl.getDisplayNames`, which works like this:\r\n\r\n```javascript\r\nmozIntl.getDisplayNames('en-US', {\r\n  style: 'long',\r\n  keys: [\r\n    'dates/fields/year',\r\n    'dates/fields/month',\r\n    'dates/fields/week',\r\n    'dates/fields/day',\r\n    'dates/gregorian/months/january',\r\n    'dates/gregorian/months/february',\r\n    'dates/gregorian/months/march',\r\n    'dates/gregorian/weekdays/tuesday'\r\n  ]\r\n}) === {\r\n  locale: 'en-US',\r\n  style: 'long',\r\n  values: {\r\n    'dates/fields/year': 'year',\r\n    'dates/fields/month': 'month',\r\n    'dates/fields/week': 'week',\r\n    'dates/fields/day': 'day',\r\n    'dates/gregorian/months/january': 'January',\r\n    'dates/gregorian/months/february': 'February',\r\n    'dates/gregorian/months/march': 'March',\r\n    'dates/gregorian/weekdays/tuesday': 'Tuesday',\r\n  }\r\n}\r\n```\r\n\r\nSo far I only added `dates/gregorian/months/*`, `dates/gregorian/weekdays/*`, `dates/gregorian/dayperiods/*` and `dates/fields/{year|month|week|day]`.\r\n\r\nAs with other `mozIntl` proprietary API's, I hope that will help us develop an ECMA402 spec proposal and I'll be happy to transition to it once it happens."}}
{"actor":{"display_login":"zbraniecki"}}