https://github.com/zbraniecki/intl-dom
Intl DOM library
https://github.com/zbraniecki/intl-dom
Last synced: about 1 year ago
JSON representation
Intl DOM library
- Host: GitHub
- URL: https://github.com/zbraniecki/intl-dom
- Owner: zbraniecki
- Created: 2015-12-08T18:29:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-08T19:02:28.000Z (over 10 years ago)
- Last Synced: 2025-01-25T06:41:35.574Z (over 1 year 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
```