Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zbraniecki/intl-dom

Intl DOM library
https://github.com/zbraniecki/intl-dom

Last synced: about 2 months ago
JSON representation

Intl DOM library

Awesome Lists containing this project

README

        

Intl DOM: Internationalization for DOM
=================================================================

Intl DOM combines the Intl API with Gaia's IntlHelper and L20n's declarative API.

In result it makes HTML internationalizable with minimum JS code required.

How to use i28n
---------------

Include the following code in the `` section of your HTML:

```html

```

In HTML
-------

```html


```

In JS
-----

```javascript

function logDateTime() {
const formatter = document.mozI18n.get('datetime', {
hour: 'numeric',
minute: 'numeric'
});
console.log(formatter.format(Date.now());
}

document.i18n.observe('datetime', logDateTime);

```

Development
-----------

```shell
> npm install --dev

> gulp lint # uses es-lint

> gulp build # builds ./dist/intl-dom.js
```