Introduction¶
Ergonomic application localisation, built on ICU — for JavaScript, PHP, Python, Java, and C#.
As long as you display data, you need to present it in a format your users will
understand. Cosmo is a thin, ergonomic layer over ICU: set the
locale (language_COUNTRY) and time zone,
and your app is ready for its audience —
currencies, dates, numbers, units, plurals, collation, and more.
One library, five languages, the same API:
Pick your language in any code tab — every sample across the whole site switches to match, so you only ever read your own.
Why ICU, and nothing but ICU¶
Everything comes straight from the runtime's ICU data — it covers every country, language, script, calendar, and time zone. Cosmo bundles no locale data of its own: there are no hardcoded tables to drift out of date. If the runtime's ICU can't produce a result, the feature is omitted, not faked.
The five ports reach ICU through different doors, which is the only reason their feature sets differ at the edges:
| Port | ICU access | Notes |
|---|---|---|
| JavaScript | the standard Intl API |
strictly Intl-only; raw-ICU features (RBNF, parsing, transliteration, …) are omitted, not faked |
| PHP | ext-intl (+ raw ResourceBundle, RBNF) |
the original library; v3 reconstructs the few newer formatters ext-intl lacks from CLDR data |
| Python | PyICU (ICU C++ bindings) | the union of PHP and JS, plus the matcher / spoof / parsing family |
| Java | ICU4J (the reference ICU implementation) | the most complete port — nothing curated away, nothing left unbound |
| C# | ICU4C (native ICU C library via P/Invoke) | near-Java completeness; a few C-API limitations (no AlphabeticIndex, no LocaleMatcher, ICU 72) |
See Feature parity for the full method-by-method matrix and Platform notes for what each port can and cannot do.
Next steps¶
- Getting started — install and your first formatted value
- Guide — every feature, with side-by-side examples
- API reference — the complete method list
- Feature parity — what's available where