Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yusufnb/dom-i18n.js
DOM element attribute based i18n plugin
https://github.com/yusufnb/dom-i18n.js
Last synced: about 2 months ago
JSON representation
DOM element attribute based i18n plugin
- Host: GitHub
- URL: https://github.com/yusufnb/dom-i18n.js
- Owner: yusufnb
- License: gpl-2.0
- Created: 2014-08-25T04:21:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-25T16:47:07.000Z (over 10 years ago)
- Last Synced: 2023-03-24T04:13:30.249Z (almost 2 years ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
About
===========dom-i18n.js is an element attribute based i18n plugin. It is intended to be used as an extension of client side templating libraries such as Mustache.js. It greatly simplifies i18n for web apps and allows changing languages without page refreshes or without writing little to no code for adding i18n support.
Dependency
==========
- jQueryNote
==========
This plugin/library does not do any magic. It should be integrated with your web app framework and passed appropriate data. Here are few places it will need integration:
- app boot process, to initialize i18n and load a language
- On language change. i18n does not read browser language changes or any other events. The app framework should handle that and invoke corresponding APIs.
- i18n.format.js is an add-on plugin and is completely optionalSetup:
======
```
i18n.config({
url: 'http://example.com/locales/', // Pull content from http://example.com/locales/en.json
});i18n.load('en', {...});
i18n.load('en'); // Load from cache or ajax on URLi18n.parse(selector);
i18n.parse(element);
```Usage:
======```
``````
``````
HelloWorld="Hello World {#} {#}"
```
```
HelloWorld="Hello World {#:date} {#:currency}
```