{"id":28430953,"url":"https://github.com/elixir-cldr/cldr_territories","last_synced_at":"2026-02-10T02:09:18.049Z","repository":{"id":26852691,"uuid":"108778302","full_name":"elixir-cldr/cldr_territories","owner":"elixir-cldr","description":"Territory formatting functions for the Common Locale Data Repository (CLDR) package https://github.com/elixir-cldr/cldr","archived":false,"fork":false,"pushed_at":"2026-02-09T04:32:04.000Z","size":211,"stargazers_count":26,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-09T10:46:48.140Z","etag":null,"topics":["cldr","elixir","elixir-lang","l10n","l18n","territories","territories-format"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-cldr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-10-29T22:56:23.000Z","updated_at":"2026-02-09T04:32:08.000Z","dependencies_parsed_at":"2023-10-13T12:34:35.884Z","dependency_job_id":"9c70e554-e4ec-4b7d-bf69-22a60c9bdcb6","html_url":"https://github.com/elixir-cldr/cldr_territories","commit_stats":{"total_commits":75,"total_committers":8,"mean_commits":9.375,"dds":0.28,"last_synced_commit":"39134a72643aeb99554982ee446bfbeb9fceb8f0"},"previous_names":["elixir-cldr/cldr_territories","schultzer/cldr_territories"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-cldr/cldr_territories","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_territories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_territories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_territories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_territories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-cldr","download_url":"https://codeload.github.com/elixir-cldr/cldr_territories/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_territories/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29288919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T21:57:15.303Z","status":"online","status_checked_at":"2026-02-10T02:00:07.935Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cldr","elixir","elixir-lang","l10n","l18n","territories","territories-format"],"created_at":"2025-06-05T14:30:37.326Z","updated_at":"2026-02-10T02:09:18.043Z","avatar_url":"https://github.com/elixir-cldr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cldr for Territories\n\n![main](https://github.com/elixir-cldr/cldr_territories/actions/workflows/ci.yml/badge.svg?branch=main)\n\n## Introduction and Getting Started\n\n`ex_cldr_territories` is an add-on library for [ex_cldr](https://hex.pm/packages/ex_cldr) that provides localization for territories.\n\n## Examples\n\n```elixir\niex\u003e MyCldr.Territory.from_territory_code(:GB)\n{:ok, \"United Kingdom\"}\n\niex\u003e MyCldr.Territory.to_territory_code(\"United Kingdom\", \"en\")\n{:ok, :GB}\n\niex\u003e MyCldr.Territory.translate_territory(\"Reino Unido\", \"pt\", \"en\")\n{:ok, \"UK\"}\n\niex\u003e MyCldr.Territory.contains?(:EU, :GB)\nfalse\n\niex\u003e MyCldr.Territory.contains?(:EU, :DE)\ntrue\n\niex\u003e MyCldr.Territory.parent(:GB)\n{:ok, [:\"154\", :UN]}\n\niex\u003e MyCldr.Territory.children(:EU)\n{:ok,\n [:AT, :BE, :CY, :CZ, :DE, :DK, :EE, :ES, :FI, :FR, :GR, :HR, :HU, :IE,\n  :IT, :LT, :LU, :LV, :MT, :NL, :PL, :PT, :SE, :SI, :SK, :BG, :RO]}\n\niex\u003e MyCldr.Territory.info(:GB)\n{:ok,\n %{\n   currency: [GBP: %{from: ~D[1694-07-27]}],\n   gdp: 2925000000000,\n   language_population: %{\n     \"bn\" =\u003e %{population_percent: 0.67},\n     \"cy\" =\u003e %{official_status: \"official_regional\", population_percent: 0.77},\n     \"de\" =\u003e %{population_percent: 6},\n     \"el\" =\u003e %{population_percent: 0.33},\n     \"en\" =\u003e %{official_status: \"official\", population_percent: 99},\n     \"fr\" =\u003e %{population_percent: 19},\n     \"ga\" =\u003e %{official_status: \"official_regional\", population_percent: 0.026},\n     \"gd\" =\u003e %{\n       official_status: \"official_regional\",\n       population_percent: 0.099,\n       writing_percent: 5\n     },\n     \"it\" =\u003e %{population_percent: 0.33},\n     \"ks\" =\u003e %{population_percent: 0.19},\n     \"kw\" =\u003e %{population_percent: 0.003},\n     \"ml\" =\u003e %{population_percent: 0.035},\n     \"pa\" =\u003e %{population_percent: 0.79},\n     \"sco\" =\u003e %{population_percent: 2.7, writing_percent: 5},\n     \"syl\" =\u003e %{population_percent: 0.51},\n     \"yi\" =\u003e %{population_percent: 0.049},\n     \"zh-Hant\" =\u003e %{population_percent: 0.54}\n   },\n   literacy_percent: 99,\n   measurement_system: %{\n     default: :uksystem,\n     paper_size: :a4,\n     temperature: :uksystem\n   },\n   population: 65761100\n }}\n\niex\u003e MyCldr.Territory.to_unicode_flag(:US)\n{:ok, \"🇺🇸\"}\n\niex\u003e MyCldr.Territory.to_currency_code(:US)\n{:ok, :USD}\n```\n\nFor help in `iex`:\n\n```elixir\niex\u003e h MyCldr.Territory.from_territory_code\n```\n\n## Documentation\n\n[hex documentation for ex_cldr](https://hexdocs.pm/ex_cldr/)\n\n[hex documentation for ex_cldr_territories](https://hexdocs.pm/ex_cldr_territories/)\n\n## Installation\n\nNote that `:ex_cldr_territories` requires Elixir 1.12 or later.\n\nAdd `ex_cldr_territories` as a dependency to your `mix` project:\n\n```elixir\n    defp deps do\n      [\n        {:ex_cldr_territories, \"~\u003e 2.10.0\"}\n      ]\n    end\n```\n\nthen retrieve `ex_cldr_territories` from [hex](https://hex.pm/packages/ex_cldr_territories):\n\n    mix deps.get\n    mix deps.compile\n\nIn order to use this library, a backend module for `ex_cldr` must be defined.  This is described in full in the `ex_cldr` [readme](https://hexdocs.pm/ex_cldr/readme.html#configuration).\nTo get started, define a backend module in your project as follows:\n\n```elixir\ndefmodule MyApp.Cldr do\n  use Cldr,\n    locales: [:en],\n    providers: [Cldr.Territory]\nend\n```\n\n## LICENSE\n\n(The MIT License)\n\nCopyright (c) 2017 Benjamin Schultzer\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_territories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-cldr%2Fcldr_territories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_territories/lists"}