Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/zbraniecki/intl-dom
- Owner: zbraniecki
- Created: 2015-12-08T18:29:34.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-08T19:02:28.000Z (about 9 years ago)
- Last Synced: 2024-10-14T16:14:39.989Z (3 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```