Format numbers, dates automatically and semantically.
<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'></data>
emits
<data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'>123.456,79 €</data>
The output element provides identical support.
<time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>
emits
<time lang="ar-EG" datetime="2011-11-18T14:54:39.929Z" be-intl="{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }">الجمعة، ١٨ نوفمبر ٢٠١١</time>
[WIP]
We can also employ more semantic syntax:
<data value=123456.789 lang="de-DE" be-intl-style=currency be-intl-currency=EUR></data>
[TODO] Support expanding out the attribute to avoid use of JSON
Any web server than can serve static files will do, but...
- Install git.
- Fork/clone this repo.
- Install node.
- Open command window to folder where you cloned this repo.
-
npm install
-
npm run serve
- Open http://localhost:3030/demo in a modern browser.
import 'be-intl/be-intl.js';
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-intl';
</script>