{"id":28430947,"url":"https://github.com/elixir-cldr/cldr_html","last_synced_at":"2025-07-04T17:31:13.844Z","repository":{"id":42677087,"uuid":"135157634","full_name":"elixir-cldr/cldr_html","owner":"elixir-cldr","description":"Phoenix HTML helpers for CLDR","archived":false,"fork":false,"pushed_at":"2025-03-16T20:33:36.000Z","size":255,"stargazers_count":7,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T14:39:38.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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.md","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}},"created_at":"2018-05-28T12:25:11.000Z","updated_at":"2025-03-16T20:33:39.000Z","dependencies_parsed_at":"2024-05-28T01:26:06.806Z","dependency_job_id":"22374aec-5618-447e-b0e5-ffff6ac20a5b","html_url":"https://github.com/elixir-cldr/cldr_html","commit_stats":{"total_commits":53,"total_committers":7,"mean_commits":7.571428571428571,"dds":"0.18867924528301883","last_synced_commit":"3a1e845e70b7a2339f25b414393c7e8a524802a7"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/elixir-cldr/cldr_html","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-cldr","download_url":"https://codeload.github.com/elixir-cldr/cldr_html/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-cldr%2Fcldr_html/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263587994,"owners_count":23484843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-06-05T14:30:36.059Z","updated_at":"2025-07-04T17:31:13.838Z","avatar_url":"https://github.com/elixir-cldr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cldr HTML\n\nPhoenix form select helper functions for CLDR. The functions in this library produce localised selection tags for HTML forms for:\n\n* Currencies\n* Units\n* Territories\n* Locales\n\n## Usage\n\n* `Cldr.HTML.Currency.select/3`. By default the currencies of the locales configured in the default backend. See also the documentation for [ex_cldr_currencies](https://hexdocs.pm/ex_cldr_currencies).\n\n* `Cldr.HTML.Unit.select/3`. By default the units returned by `Cldr.Unit.known_units/0`. See also the documentation for [ex_cldr_units](https://hexdocs.pm/ex_cldr_units).\n\n* `Cldr.HTML.Territory.select/3`. By default the territories returned by `Cldr.known_territories/0`. See also the documentation for [ex_cldr_territories](https://hexdocs.pm/ex_cldr_territories)\n\n* `Cldr.HTML.Locale.select/3`. By default the list of locales known to `Cldr.default_backend!/0`. See also the documentation for [ex_cldr_locale_display](https://hexdocs.pm/ex_cldr_locale_display).\n\n* [Not Yet Implemented] Select days of the week and months of the year in a given locale.\n\n## Currency selection\n\n```elixir\niex\u003e Cldr.HTML.Currency.select(:my_form, :currency, selected: :USD, currencies: ~w(usd eur jpy cop)) |\u003e Phoenix.HTML.safe_to_string()\n```\nProduces, when formatted:\n```html\n\u003cselect id=\"my_form_currency\" name=\"my_form[currency]\"\u003e\n\t\u003coption value=\"COP\"\u003eCOP - Colombian Peso\u003c/option\u003e\n\t\u003coption value=\"EUR\"\u003eEUR - Euro\u003c/option\u003e\n\t\u003coption value=\"JPY\"\u003eJPY - Japanese Yen\u003c/option\u003e\n\t\u003coption value=\"USD\" selected\u003eUSD - US Dollar\u003c/option\u003e\n\u003c/select\u003e\n```\n\n## Unit selection\n\n```elixir\niex\u003e Cldr.HTML.Unit.select(:my_form, :units) |\u003e Phoenix.HTML.safe_to_string()\n```\nProduces, when formatted:\n```html\n\u003cselect id=my_form_units name=my_form[units]\u003e\n\t\u003coption value=acre\u003eacres\u003c/option\u003e\n\t\u003coption value=acre_foot\u003eacre-feet\u003c/option\u003e\n\t\u003coption value=ampere\u003eamperes\u003c/option\u003e\n\t\u003coption value=arc_minute\u003earcminutes\u003c/option\u003e\n\t\u003coption value=arc_second\u003earcseconds\u003c/option\u003e\n\t\u003coption value=astronomical_unit\u003eastronomical units\u003c/option\u003e\n\t\u003coption value=atmosphere\u003eatmospheres\u003c/option\u003e\n\t\u003coption value=bar\u003ebars\u003c/option\u003e\n\t\u003coption value=barrel\u003ebarrels\u003c/option\u003e\n\t\u003coption value=bit\u003ebits\u003c/option\u003e\n\t\u003coption value=british_thermal_unit\u003eBritish thermal units\u003c/option\u003e\n\t\u003coption value=bushel\u003ebushels\u003c/option\u003e\n\t\u003coption value=byte\u003ebytes\u003c/option\u003e\n\t\u003coption value=calorie\u003ecalories\u003c/option\u003e\n\t\u003coption value=candela\u003ecandela\u003c/option\u003e\n\t\u003coption value=carat\u003ecarats\u003c/option\u003e\n\t\u003coption value=celsius\u003edegrees Celsius\u003c/option\u003e\n    ....\n\u003c/select\u003e\n```\n\n## Territory selection\n\n```elixir\niex\u003e Cldr.HTML.Territory.select(:my_form, :territory, territories: [:US, :AU, :JP]) |\u003e Phoenix.HTML.safe_to_string()\n```\nProduces, when formatted:\n```html\n\u003cselect id=\"my_form_territory\" name=\"my_form[territory]\"\u003e\n\t\u003coption value=\"AU\"\u003e🇦🇺 Australia\u003c/option\u003e\n\t\u003coption value=\"JP\"\u003e🇯🇵 Japan\u003c/option\u003e\n\t\u003coption value=\"US\"\u003e🇺🇸 United States\u003c/option\u003e\n\u003c/select\u003e\n```\n## Locale selection\n\n```elixir\n# Select from the locales configured in `Cldr.default_backend/0` and localize them\n# using the locale `Cldr.default_locale/0`\niex\u003e Cldr.HTML.Locale.select(:my_form, :locales) |\u003e Phoenix.HTML.safe_to_string()\n```\nProduces, when formatted:\n```html\n\u003cselect id=\"my_form_locales\" name=\"my_form[locales]\"\u003e\n\t\u003coption value=\"ar\"\u003eArabic\u003c/option\u003e\n\t\u003coption value=\"zh-Hans\"\u003eChinese (Simplified)\u003c/option\u003e\n\t\u003coption value=\"zh-Hant\"\u003eChinese (Traditional)\u003c/option\u003e\n\t\u003coption value=\"en\"\u003eEnglish\u003c/option\u003e\n\t\u003coption value=\"he\"\u003eHebrew\u003c/option\u003e\n\t\u003coption value=\"th\"\u003eThai\u003c/option\u003e\n\u003c/select\u003e\n```\n\n```elixir\n# Select from the locales configured in `Cldr.default_backend/0` and localize them\n# using their own locale`\niex\u003e Cldr.HTML.Locale.select(:my_form, :locales, locale: :identity) |\u003e Phoenix.HTML.safe_to_string()\n```\nProduces, when formatted:\n```html\n\u003cselect id=\"my_form_locales\" name=\"my_form[locales]\"\u003e\n\t\u003coption value=\"en\"\u003eEnglish\u003c/option\u003e\n\t\u003coption value=\"he\"\u003eעברית\u003c/option\u003e\n\t\u003coption value=\"ar\"\u003eالعربية\u003c/option\u003e\n\t\u003coption value=\"th\"\u003eไทย\u003c/option\u003e\n\t\u003coption value=\"zh-Hans\"\u003e简体中文\u003c/option\u003e\n\t\u003coption value=\"zh-Hant\"\u003e繁體中文\u003c/option\u003e\n\u003c/select\u003e\n```\n\n## Installation\n\n`Cldr.HTML` can be installed by adding `cldr_html` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:cldr_html, \"~\u003e 0.6\"}\n  ]\nend\n```\nThe documentation can be found at [https://hexdocs.pm/cldr_html](https://hexdocs.pm/cldr_html).\n\n## Configuration\n\nThe available functions depends on the configured dependencies in `mix.exs`:\n\nFor `Cldr.HTML.Currency.select/3`:\n\n    {:ex_cldr_currencies, \"~\u003e 2.11\"},\n\nFor `Cldr.HTML.Unit.select/3`:\n\n    {:ex_cldr_units, \"~\u003e 3.7\"},\n\nFor `Cldr.HTML.Locale.select/3`:\n\n    {:ex_cldr_locale_display, \"~\u003e 1.0\"},\n\nFor `Cldr.HTML.Territory.select/3`:\n\n    {:ex_cldr_territories, \"~\u003e 2.2\"},","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-cldr%2Fcldr_html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-cldr%2Fcldr_html/lists"}