{"id":21679998,"url":"https://github.com/squarespace/cldr-engine-java","last_synced_at":"2025-10-08T20:20:49.172Z","repository":{"id":57727219,"uuid":"236086904","full_name":"Squarespace/cldr-engine-java","owner":"Squarespace","description":"Java port of @phensley/cldr Typescript library","archived":false,"fork":false,"pushed_at":"2025-05-13T16:40:51.000Z","size":1546,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T17:35:00.560Z","etag":null,"topics":["cldr","formatting","i18n","internationalization","java"],"latest_commit_sha":null,"homepage":"https://phensley.github.io/cldr-engine/docs/en/api-cldr","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Squarespace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-01-24T21:30:05.000Z","updated_at":"2025-05-13T16:40:55.000Z","dependencies_parsed_at":"2024-09-05T20:31:37.130Z","dependency_job_id":"24d9acf5-0a31-4aca-a7e4-f60eb1c43377","html_url":"https://github.com/Squarespace/cldr-engine-java","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"purl":"pkg:github/Squarespace/cldr-engine-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squarespace%2Fcldr-engine-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squarespace%2Fcldr-engine-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squarespace%2Fcldr-engine-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squarespace%2Fcldr-engine-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Squarespace","download_url":"https://codeload.github.com/Squarespace/cldr-engine-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Squarespace%2Fcldr-engine-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000662,"owners_count":26082817,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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","formatting","i18n","internationalization","java"],"created_at":"2024-11-25T15:13:54.218Z","updated_at":"2025-10-08T20:20:49.135Z","avatar_url":"https://github.com/Squarespace.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Port of @phensley/cldr to Java.\n\n[![javadoc](https://javadoc.io/badge2/com.squarespace.cldr-engine/cldr-engine/javadoc.svg)](https://javadoc.io/doc/com.squarespace.cldr-engine/cldr-engine)\n\nThe API is compatible with that of the TypeScript [@phensley/cldr](https://phensley.github.io/cldr-engine/docs/en/api-cldr) library.\n\nExample usage\n\n```java\nfor (String locale : new String[] { \"en-US\", \"es-419\", \"fr\", \"zh\" }) {\n  System.out.println(\"Locale: \" + locale + \":\");\n\n  CLDR cldr = CLDR.get(locale);\n  String s;\n\n  s = cldr.Numbers.formatCurrency(new Decimal(\"12345.6789\"), CurrencyType.USD);\n  System.out.println(s);\n\n  CurrencyFormatOptions currencyOpts = CurrencyFormatOptions.build()\n      .style(CurrencyFormatStyleType.SHORT);\n  s = cldr.Numbers.formatCurrency(new Decimal(\"12345.6789\"), CurrencyType.USD, currencyOpts);\n  System.out.println(s);\n\n  DateFormatOptions dateOpts = DateFormatOptions.build()\n      .date(FormatWidthType.LONG)\n      .time(FormatWidthType.MEDIUM);\n  GregorianDate date = cldr.Calendars.toGregorianDate(1582060591000L, \"America/New_York\");\n  s = cldr.Calendars.formatDate(date, dateOpts);\n  System.out.println(s);\n\n  GregorianDate end = cldr.Calendars.toGregorianDate(1583334991000L, \"America/New_York\");\n  s = cldr.Calendars.formatDateInterval(date, end, null);\n  System.out.println(s);\n\n  Quantity qty = Quantity.build().value(new Decimal(\"3413\")).unit(UnitType.MILE);\n  s = cldr.Units.formatQuantity(qty, null);\n  System.out.println(s);\n\n  List\u003cQuantity\u003e seq = Arrays.asList(\n      Quantity.build().value(new Decimal(\"17\")).unit(UnitType.HOUR),\n      Quantity.build().value(new Decimal(\"37.2\")).unit(UnitType.MINUTE)\n  );\n  s = cldr.Units.formatQuantitySequence(seq, UnitFormatOptions.build().length(UnitLength.SHORT));\n  System.out.println(s);\n\n  System.out.println();\n}\n```\n\n```\nLocale: en-US:\n$12,345.68\n$12K\nFebruary 18, 2020 at 4:16:31 PM\nFeb 18 – Mar 4, 2020\n3,413 miles\n17 hr, 37.2 min\n\nLocale: es-419:\nUSD 12,345.68\nUSD 12 K\n18 de febrero de 2020 a las 16:16:31\n18 de feb. – 4 de mar. de 2020\n3413 millas\n17 h y 37.2 min\n\nLocale: fr:\n12 345,68 $US\n12 k $US\n18 février 2020 à 16:16:31\n18 févr. – 4 mars 2020\n3 413 miles\n17 h et 37,2 min\n\nLocale: zh:\nUS$12,345.68\nUS$1.2万\n2020年2月18日 下午4:16:31\n2020年2月18日至3月4日\n3,413英里\n17小时37.2分钟\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquarespace%2Fcldr-engine-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquarespace%2Fcldr-engine-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquarespace%2Fcldr-engine-java/lists"}