{"action":"created","issue":{"url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/3","repository_url":"https://api.github.com/repos/Schultzer/cldr_territories","labels_url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/3/comments","events_url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/3/events","html_url":"https://github.com/Schultzer/cldr_territories/issues/3","id":274850119,"number":3,"title":"Enhancement idea:  flags for territories","user":{"login":"kipcole9","id":15895,"avatar_url":"https://avatars2.githubusercontent.com/u/15895?v=4","gravatar_id":"","url":"https://api.github.com/users/kipcole9","html_url":"https://github.com/kipcole9","followers_url":"https://api.github.com/users/kipcole9/followers","following_url":"https://api.github.com/users/kipcole9/following{/other_user}","gists_url":"https://api.github.com/users/kipcole9/gists{/gist_id}","starred_url":"https://api.github.com/users/kipcole9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kipcole9/subscriptions","organizations_url":"https://api.github.com/users/kipcole9/orgs","repos_url":"https://api.github.com/users/kipcole9/repos","events_url":"https://api.github.com/users/kipcole9/events{/privacy}","received_events_url":"https://api.github.com/users/kipcole9/received_events","type":"User","site_admin":false},"labels":[{"id":734666869,"url":"https://api.github.com/repos/Schultzer/cldr_territories/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"Schultzer","id":10013742,"avatar_url":"https://avatars3.githubusercontent.com/u/10013742?v=4","gravatar_id":"","url":"https://api.github.com/users/Schultzer","html_url":"https://github.com/Schultzer","followers_url":"https://api.github.com/users/Schultzer/followers","following_url":"https://api.github.com/users/Schultzer/following{/other_user}","gists_url":"https://api.github.com/users/Schultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/Schultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schultzer/subscriptions","organizations_url":"https://api.github.com/users/Schultzer/orgs","repos_url":"https://api.github.com/users/Schultzer/repos","events_url":"https://api.github.com/users/Schultzer/events{/privacy}","received_events_url":"https://api.github.com/users/Schultzer/received_events","type":"User","site_admin":false},"assignees":[{"login":"Schultzer","id":10013742,"avatar_url":"https://avatars3.githubusercontent.com/u/10013742?v=4","gravatar_id":"","url":"https://api.github.com/users/Schultzer","html_url":"https://github.com/Schultzer","followers_url":"https://api.github.com/users/Schultzer/followers","following_url":"https://api.github.com/users/Schultzer/following{/other_user}","gists_url":"https://api.github.com/users/Schultzer/gists{/gist_id}","starred_url":"https://api.github.com/users/Schultzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schultzer/subscriptions","organizations_url":"https://api.github.com/users/Schultzer/orgs","repos_url":"https://api.github.com/users/Schultzer/repos","events_url":"https://api.github.com/users/Schultzer/events{/privacy}","received_events_url":"https://api.github.com/users/Schultzer/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-11-17T12:29:26Z","updated_at":"2017-11-18T01:48:12Z","closed_at":null,"author_association":"COLLABORATOR","body":"@Schultzer Had a spare moment on a plane and thought maybe adding unicode flags to cldr_territories might be worth while (I know I have a couple of use cases).  I created a simple module below, happy to do a PR if that suits you.\r\n\r\n```elixir\r\ndefmodule Cldr.Territory do\r\n  @flags File.read!(\"priv/flags.csv\")\r\n  Enum.each String.split(@flags, \"\\n\"), fn line ->\r\n    case String.split(line, \",\") do\r\n      [flag, territory] ->\r\n        def flag_for(unquote(String.to_atom(territory))), do: {:ok, unquote(String.trim(flag))}\r\n      [_] ->\r\n        nil\r\n    end\r\n  end\r\n\r\n  def flag_for(territory) do\r\n    {:error, {Cldr.UnknownTerritoryError, \"Unknown territory #{inspect territory}\"}}\r\n  end\r\n\r\n  def flag_for!(territory) do\r\n    case flag_for(territory) do\r\n      {:ok, flag} -> flag\r\n      {:error, {exception, reason}} -> raise exception, reason\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nThe flags file is nothing more than:\r\n```\r\n🇦🇨,AC\r\n🇦🇩,AD\r\n🇦🇪,AE\r\n🇦🇫,AF\r\n🇦🇬,AG\r\n🇦🇮,AI\r\n🇦🇱,AL\r\n🇦🇲,AM\r\n🇦🇴,AO\r\n🇦🇶,AQ\r\n🇦🇷,AR\r\n🇦🇸,AS\r\n🇦🇹,AT\r\n🇦🇺,AU\r\n🇦🇼,AW\r\n🇦🇽,AX\r\n🇦🇿,AZ\r\n🇧🇦,BA\r\n🇧🇧,BB\r\n🇧🇩,BD\r\n🇧🇪,BE\r\n🇧🇫,BF\r\n🇧🇬,BG\r\n🇧🇭,BH\r\n🇧🇮,BI\r\n🇧🇯,BJ\r\n🇧🇱,BL\r\n🇧🇲,BM\r\n🇧🇳,BN\r\n🇧🇴,BO\r\n🇧🇶,BQ\r\n🇧🇷,BR\r\n🇧🇸,BS\r\n🇧🇹,BT\r\n🇧🇻,BV\r\n🇧🇼,BW\r\n🇧🇾,BY\r\n🇧🇿,BZ\r\n🇨🇦,CA\r\n🇨🇨,CC\r\n🇨🇩,CD\r\n🇨🇫,CF\r\n🇨🇬,CG\r\n🇨🇭,CH\r\n🇨🇮,CI\r\n🇨🇰,CK\r\n🇨🇱,CL\r\n🇨🇲,CM\r\n🇨🇳,CN\r\n🇨🇴,CO\r\n🇨🇵,CP\r\n🇨🇷,CR\r\n🇨🇺,CU\r\n🇨🇻,CV\r\n🇨🇼,CW\r\n🇨🇽,CX\r\n🇨🇾,CY\r\n🇨🇿,CZ\r\n🇩🇪,DE\r\n🇩🇬,DG\r\n🇩🇯,DJ\r\n🇩🇰,DK\r\n🇩🇲,DM\r\n🇩🇴,DO\r\n🇩🇿,DZ\r\n🇪🇦,EA\r\n🇪🇨,EC\r\n🇪🇪,EE\r\n🇪🇬,EG\r\n🇪🇭,EH\r\n🇪🇷,ER\r\n🇪🇸,ES\r\n🇪🇹,ET\r\n🇪🇺,EU\r\n🇫🇮,FI\r\n🇫🇯,FJ\r\n🇫🇰,FK\r\n🇫🇲,FM\r\n🇫🇴,FO\r\n🇫🇷,FR\r\n🇬🇦,GA\r\n🇬🇧,GB\r\n🇬🇩,GD\r\n🇬🇪,GE\r\n🇬🇫,GF\r\n🇬🇬,GG\r\n🇬🇭,GH\r\n🇬🇮,GI\r\n🇬🇱,GL\r\n🇬🇲,GM\r\n🇬🇳,GN\r\n🇬🇵,GP\r\n🇬🇶,GQ\r\n🇬🇷,GR\r\n🇬🇸,GS\r\n🇬🇹,GT\r\n🇬🇺,GU\r\n🇬🇼,GW\r\n🇬🇾,GY\r\n🇭🇰,HK\r\n🇭🇲,HM\r\n🇭🇳,HN\r\n🇭🇷,HR\r\n🇭🇹,HT\r\n🇭🇺,HU\r\n🇮🇨,IC\r\n🇮🇩,ID\r\n🇮🇪,IE\r\n🇮🇱,IL\r\n🇮🇲,IM\r\n🇮🇳,IN\r\n🇮🇴,IO\r\n🇮🇶,IQ\r\n🇮🇷,IR\r\n🇮🇸,IS\r\n🇮🇹,IT\r\n🇯🇪,JE\r\n🇯🇲,JM\r\n🇯🇴,JO\r\n🇯🇵,JP\r\n🇰🇪,KE\r\n🇰🇬,KG\r\n🇰🇭,KH\r\n🇰🇮,KI\r\n🇰🇲,KM\r\n🇰🇳,KN\r\n🇰🇵,KP\r\n🇰🇷,KR\r\n🇰🇼,KW\r\n🇰🇾,KY\r\n🇰🇿,KZ\r\n🇱🇦,LA\r\n🇱🇧,LB\r\n🇱🇨,LC\r\n🇱🇮,LI\r\n🇱🇰,LK\r\n🇱🇷,LR\r\n🇱🇸,LS\r\n🇱🇹,LT\r\n🇱🇺,LU\r\n🇱🇻,LV\r\n🇱🇾,LY\r\n🇲🇦,MA\r\n🇲🇨,MC\r\n🇲🇩,MD\r\n🇲🇪,ME\r\n🇲🇫,MF\r\n🇲🇬,MG\r\n🇲🇭,MH\r\n🇲🇰,MK\r\n🇲🇱,ML\r\n🇲🇲,MM\r\n🇲🇳,MN\r\n🇲🇴,MO\r\n🇲🇵,MP\r\n🇲🇶,MQ\r\n🇲🇷,MR\r\n🇲🇸,MS\r\n🇲🇹,MT\r\n🇲🇺,MU\r\n🇲🇻,MV\r\n🇲🇼,MW\r\n🇲🇽,MX\r\n🇲🇾,MY\r\n🇲🇿,MZ\r\n🇳🇦,NA\r\n🇳🇨,NC\r\n🇳🇪,NE\r\n🇳🇫,NF\r\n🇳🇬,NG\r\n🇳🇮,NI\r\n🇳🇱,NL\r\n🇳🇴,NO\r\n🇳🇵,NP\r\n🇳🇷,NR\r\n🇳🇺,NU\r\n🇳🇿,NZ\r\n🇴🇲,OM\r\n🇵🇦,PA\r\n🇵🇪,PE\r\n🇵🇫,PF\r\n🇵🇬,PG\r\n🇵🇭,PH\r\n🇵🇰,PK\r\n🇵🇱,PL\r\n🇵🇲,PM\r\n🇵🇳,PN\r\n🇵🇷,PR\r\n🇵🇸,PS\r\n🇵🇹,PT\r\n🇵🇼,PW\r\n🇵🇾,PY\r\n🇶🇦,QA\r\n🇷🇪,RE\r\n🇷🇴,RO\r\n🇷🇸,RS\r\n🇷🇺,RU\r\n🇷🇼,RW\r\n🇸🇦,SA\r\n🇸🇧,SB\r\n🇸🇨,SC\r\n🇸🇩,SD\r\n🇸🇪,SE\r\n🇸🇬,SG\r\n🇸🇭,SH\r\n🇸🇮,SI\r\n🇸🇯,SJ\r\n🇸🇰,SK\r\n🇸🇱,SL\r\n🇸🇲,SM\r\n🇸🇳,SN\r\n🇸🇴,SO\r\n🇸🇷,SR\r\n🇸🇸,SS\r\n🇸🇹,ST\r\n🇸🇻,SV\r\n🇸🇽,SX\r\n🇸🇾,SY\r\n🇸🇿,SZ\r\n🇹🇦,TA\r\n🇹🇨,TC\r\n🇹🇩,TD\r\n🇹🇫,TF\r\n🇹🇬,TG\r\n🇹🇭,TH\r\n🇹🇯,TJ\r\n🇹🇰,TK\r\n🇹🇱,TL\r\n🇹🇲,TM\r\n🇹🇳,TN\r\n🇹🇴,TO\r\n🇹🇷,TR\r\n🇹🇹,TT\r\n🇹🇻,TV\r\n🇹🇼,TW\r\n🇹🇿,TZ\r\n🇺🇦,UA\r\n🇺🇬,UG\r\n🇺🇲,UM\r\n🇺🇳,UN\r\n🇺🇸,US\r\n🇺🇾,UY\r\n🇺🇿,UZ\r\n🇻🇦,VA\r\n🇻🇨,VC\r\n🇻🇪,VE\r\n🇻🇬,VG\r\n🇻🇮,VI\r\n🇻🇳,VN\r\n🇻🇺,VU\r\n🇼🇫,WF\r\n🇼🇸,WS\r\n🇽🇰,XK\r\n🇾🇪,YE\r\n🇾🇹,YT\r\n🇿🇦,ZA\r\n🇿🇲,ZM\r\n🇿🇼,ZW\r\n```"},"comment":{"url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/comments/345409103","html_url":"https://github.com/Schultzer/cldr_territories/issues/3#issuecomment-345409103","issue_url":"https://api.github.com/repos/Schultzer/cldr_territories/issues/3","id":345409103,"user":{"login":"kipcole9","id":15895,"avatar_url":"https://avatars2.githubusercontent.com/u/15895?v=4","gravatar_id":"","url":"https://api.github.com/users/kipcole9","html_url":"https://github.com/kipcole9","followers_url":"https://api.github.com/users/kipcole9/followers","following_url":"https://api.github.com/users/kipcole9/following{/other_user}","gists_url":"https://api.github.com/users/kipcole9/gists{/gist_id}","starred_url":"https://api.github.com/users/kipcole9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kipcole9/subscriptions","organizations_url":"https://api.github.com/users/kipcole9/orgs","repos_url":"https://api.github.com/users/kipcole9/repos","events_url":"https://api.github.com/users/kipcole9/events{/privacy}","received_events_url":"https://api.github.com/users/kipcole9/received_events","type":"User","site_admin":false},"created_at":"2017-11-18T01:48:12Z","updated_at":"2017-11-18T01:48:12Z","author_association":"COLLABORATOR","body":"I’ve just put ex_cldr v1.0.0-rc.0 up on hex so perhaps thats the right development target?  I’m working on updating my other dependencies now to the same status (it’ll take a few days I think).\n\n> On 18 Nov. 2017, at 9:02 am, Benjamin Schultzer <notifications@github.com> wrote:\n> \n> Okay sounds good :) I'm gonna do some more work on the guarding and tests.\n> we can only construct flags for territory_codes that contain letters from A..Z\n> I'm planning to have this done today.\n> \n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub <https://github.com/Schultzer/cldr_territories/issues/3#issuecomment-345405144>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAA-F81rPzPPwDlGjbM8-iruCqVcU1Vuks5s3iyUgaJpZM4Qh-Kp>.\n> \n\n"}}
{"actor":{"display_login":"kipcole9"}}